DB2 10.5 for Linux, UNIX and Windows

Datums- und Zeitformate nach Gebietscodes

Die Zeichenfolgen für Datums- und Zeitformate entsprechen dem Standardformat der Werte für Datum und Uhrzeit, die dem Clientgebietscode der Anwendung zugeordnet sind.

Sie können das Standarddatums- und -zeitformat in jeder Anwendungsschnittstelle außer Kraft setzen. Es gibt folgende Möglichkeiten, um das Standardformat außer Kraft zu setzen:
  • CLI/ODBC-Anwendungen verwenden das Konfigurationsschlüsselwort DateTimeStringFormat.
  • JDBC-Anwendungen verwenden die Eigenschaft 'dateFormat' oder 'timeFormat'.
  • Eingebettete Anwendungen verwenden den Befehl PRECOMPILE oder BIND.
  • DB2-Dienstprogramme binden db2ubind.lst erneut mit der Formatoption DATETIME.
Tabelle 1. Gebietscodebeschreibungen
Gebietscode Beschreibung
DEF Standardgebietscode
EUR IBM Standard für Europa
ISO International Standards Organization
JIS Japanese Industrial Standard
LOC Lokales Format, das dem Gebietscode der Datenbank zugeordnet ist
USA IBM Standard für die Vereinigten Staaten

Es folgt eine Beschreibung der Ein- und Ausgabeformate für Datum und Uhrzeit:

  • Eingabezeitformat
    • Es gibt kein Standardformat für Uhrzeiteingaben.
    • Für alle Gebietscodes können alle Zeitformate eingegeben werden.
  • Ausgabezeitformat
    • Der Standardwert für die Ausgabe des Zeitangaben entspricht dem lokalen Zeitformat.
  • Eingabedatumsformat
    • Es gibt kein Standardformat für Datumseingaben.
    • Wenn das lokale Format für das Datum und ein ISO-, JIS-, EUR- oder USA-Datumsformat nicht übereinstimmen, wird das lokale Format für die Datumseingabe angenommen. Siehe z. B. den Eintrag für das UK in Tabelle 2.
  • Ausgabedatumsformat
    • Das Standardformat für das Ausgabedatum wird in Tabelle 2 gezeigt.
      Anmerkung: Tabelle 2 zeigt außerdem eine Liste der Zeichenfolgeformate für die verschiedenen Gebietscodes.
Tabelle 2. Datums- und Zeitformate nach Gebietscode
Gebietscode des Clients Lokales Datumsformat Lokales Zeitformat Standard- ausgabe- datums- format Eingabe- datumsformate
355 Albanien jjjj-mm-tt JIS LOC LOC, USA, EUR, ISO
785 Arabisch tt/mm/jjjj JIS LOC LOC, EUR, ISO
374 Armenien jjjj-mm-tt JIS USA LOC, USA, EUR, ISO
001 Australien (1) mm-tt-jjjj JIS USA LOC, USA, EUR, ISO
061 Australien tt-mm-jjjj JIS LOC LOC, USA, EUR, ISO
043 Österreich tt/mm/jjjj ISO ISO LOC, EUR, ISO
994 Aserbaidschan jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
880 Bangladesch tt/mm/jjjj JIS LOC LOC, EUR, ISO
375 Weißrussland jjjj-mm-tt ISO ISO LOC, EUR, ISO
032 Belgien tt/mm/jjjj JIS LOC LOC, EUR, ISO
055 Brasilien tt/mm/jjjj JIS LOC LOC, EUR, ISO
359 Bulgarien tt.mm.jjjj JIS EUR LOC, USA, EUR, ISO
855 Kambodscha tt/mm/jjjj JIS LOC LOC, EUR, ISO
001 Kanada mm-tt-jjjj JIS USA LOC, USA, EUR, ISO
002 Kanada (Französisch) tt-mm-jjjj ISO ISO LOC, USA, EUR, ISO
086 China mm/tt/jjjj JIS ISO LOC, USA, EUR, ISO
385 Kroatien jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
042 Tschechische Republik jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
045 Dänemark tt-mm-jjjj ISO ISO LOC, USA, EUR, ISO
372 Estland tt-mm-jjjj JIS LOC LOC, USA, EUR, ISO
251 Äthiopien tt/mm/jjjj JIS LOC LOC, EUR, ISO
358 Finnland tt/mm/jjjj ISO EUR LOC, EUR, ISO
389 FJR Republik Mazedonien tt.mm.jjjj JIS EUR LOC, USA, EUR, ISO
033 Frankreich tt/mm/jjjj JIS EUR LOC, EUR, ISO
995 Georgien jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
049 Deutschland tt/mm/jjjj ISO ISO LOC, EUR, ISO
030 Griechenland tt/mm/jjjj JIS LOC LOC, EUR, ISO
852 Hongkong, chinesische Sonderverwaltungsregion jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
036 Ungarn jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
354 Island tt-mm-jjjj JIS LOC LOC, USA, EUR, ISO
091 Indien tt/mm/jjjj JIS LOC LOC, EUR, ISO
062 Indonesien tt/mm/jjjj JIS LOC LOC, EUR, ISO
353 Irland tt/mm/jjjj JIS LOC LOC, EUR, ISO
972 Israel tt/mm/jjjj JIS LOC LOC, EUR, ISO
039 Italien tt/mm/jjjj JIS LOC LOC, EUR, ISO
081 Japan mm/tt/jjjj JIS ISO LOC, USA, EUR, ISO
007 Kasachstan tt/mm/jjjj JIS EUR LOC, EUR, ISO
254 Kenia tt/mm/jjjj JIS LOC LOC, EUR, ISO
082 Korea mm/tt/jjjj JIS ISO LOC, USA, EUR, ISO
001 Lateinamerika (1) mm-tt-jjjj JIS USA LOC, USA, EUR, ISO
003 Lateinamerika tt/mm/jjjj JIS LOC LOC, EUR, ISO
371 Lettland jjjj.tt.mm JIS LOC LOC, USA, EUR, ISO
370 Litauen jjjj.mm.tt JIS LOC LOC, USA, EUR, ISO
060 Malaysia tt/mm/jjjj JIS LOC LOC, EUR, ISO
356 Malta tt/mm/jjjj JIS LOC LOC, EUR, ISO
382 Montenegro jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
977 Nepal jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
031 Niederlande tt-mm-jjjj JIS ISO LOC, USA, EUR, ISO
064 Neuseeland tt-mm-jjjj JIS LOC LOC, USA, EUR, ISO
234 Nigeria tt/mm/jjjj JIS LOC LOC, EUR, ISO
047 Norwegen tt/mm/jjjj ISO EUR LOC, EUR, ISO
092 Pakistan tt/mm/jjjj JIS LOC LOC, EUR, ISO
63 Philippinen jjjj-mm-tt JIS USA LOC, USA, EUR, ISO
048 Polen jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
351 Portugal tt/mm/jjjj JIS LOC LOC, EUR, ISO
040 Rumänien jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
007 Russland tt/mm/jjjj ISO EUR LOC, EUR, ISO
250 Ruanda tt/mm/jjjj JIS LOC LOC, EUR, ISO
221 Senegal tt/mm/jjjj JIS LOC LOC, EUR, ISO
381 Serbien jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
042 Slowakei jjjj-mm-tt JIS ISO LOC, USA, EUR, ISO
386 Slowenien tt-mm-jjjj JIS EUR LOC, USA, EUR, ISO
027 Südafrika mm-tt-jjjj JIS USA LOC, USA, EUR, ISO
034 Spanien tt/mm/jjjj JIS LOC LOC, EUR, ISO
094 Sri Lanka tt-mm-jjjj JIS ISO LOC, USA, EUR, ISO
046 Schweden tt/mm/jjjj ISO ISO LOC, EUR, ISO
041 Schweiz tt/mm/jjjj ISO EUR LOC, EUR, ISO
088 Taiwan mm-tt-jjjj JIS ISO LOC, USA, EUR, ISO
255 Tansania tt/mm/jjjj JIS LOC LOC, EUR, ISO
066 Thailand (2) tt/mm/jjjj JIS LOC LOC, EUR, ISO
090 Türkei tt/mm/jjjj JIS LOC LOC, EUR, ISO
256 Uganda tt/mm/jjjj JIS LOC LOC, EUR, ISO
380 Ukraine tt/mm/jjjj JIS ISO LOC, EUR, ISO
044 Großbritannien tt/mm/jjjj JIS LOC LOC, EUR, ISO
001 USA mm-tt-jjjj JIS USA LOC, USA, EUR, ISO
998 Usbekistan jjjj-mm-tt JIS LOC LOC, USA, EUR, ISO
084 Vietnam tt/mm/jjjj JIS LOC LOC, EUR, ISO
Anmerkung:
  1. Ländern/Regionen, die die standardmäßige Ländereinstellung C (Locale C) verwenden, wird der Gebietscode 001 zugeordnet.
  2. jjjj in der buddhistischen Zeitrechnung entspricht der gregorianischen Zeitrechnung + 543 Jahre (nur Thailand).

Beispiel

Sie können mithilfe der Befehlszeile das Standarddatumsformat folgendermaßen in ISO (JJJ-MM-TT) ändern:
  1. Ändern Sie Ihr aktuelles Verzeichnis in sqllib\bnd.
    • Ändern Sie unter Windows das Verzeichnis in c:\Programme\IBM\sqllib\bnd.
    • Ändern Sie unter UNIX das Verzeichnis in /home/db2inst1/sqllib/bnd.
  2. Stellen Sie mithilfe der Berechtigung SYSADM über die Betriebssystem-Shell eine Verbindung zur Datenbank her:
    db2 connect to DBNAME
    db2 bind @db2ubind.lst datetime ISO blocking all grant public
    wobei DBNAME der Datenbankname und ISO das neue Datumsformat ist.