You are here:   » Home » Documentation » Details » ZMS API » acc. to Objects » _zmsglobals » DateTime

DateTime

ZMSGlobals.getLangFmtDate(t, lang, fmt='DATETIME_FMT')

BESCHREIBUNG:
Gives back a formatted string of the stated time (resp. of the date) (e.g. '01.01.2000').

EINGABE-PARAMETER:
t: time (resp. date) as NTuple or as Time(secs).
lang: ID of the current language (e.g. 'ger', 'eng').
fmt: ID of the format-strings ('DATE_FMT'= Date, 'TIME_FMT'= Time, 'DATETIME_FMT'= Date/Time)

AUSGABE-PARAMETER:
string: the formatted time (resp. date)

BEISPIELE
[1]  Formats the dates of the birthdays for a list of staff members (as special objects):
  <dtml-in "filteredChildNodes(REQUEST,'employee')">
    <dtml-var "getLangFmtDate(getObjProperty('birthday_dt',REQUEST),lang,'DATE_FMT')">
  </dtml-in>
[2]  Formats the current Zope-time as date with time declaration:
  <dtml-var "getLangFmtDate(ZopeTime(),lang,'DATETIME_FMT')">


ZMSGlobals.parseLangFmtDate(v, lang, fmt='DATETIME_FMT')

BESCHREIBUNG:
The function parseLangFmtDate tries to generate from the parameter v handed over with the formatting given by fmt a time-tupel and delivers it back; None if no time-tupel can be generated.

EINGABE-PARAMETER:
v: Date/Time as String or DateTime.
lang: ID of the current language (e.g. 'ger', 'eng').
fmt: ID of the format-string ('DATE_FMT'= Date, 'TIME_FMT'= Time, 'DATETIME_FMT'= Date/Time)

AUSGABE-PARAMETER:
tuple: Date/Time as Time-Tupel

BEISPIELE
[1]  Converts the current Zope-time from DateTime to Time-Tupel:
  <dtml-var "parseLangFmtDate(ZopeTime(),lang,'DATETIME_FMT')">