Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Examples

Example 1

Code Block
languagejs
string format = "yyyy.MM.dd G 'at' HH:mm:ss z";
print("Current time is " + formatDate(currentDate(), format));

Assuming that current date is 30.10.2011 and time 12:08, prints Today is 2011.10.30 AD at 12:08:00 PDT

Example 2

Code Block
languagejs
date varDateTime = "2011 -08 -17 T18: 30: 55";
string format = "EEE, d MMM yyyy HH:mm:ss Z";
print ("Formatted date is" + formatDate(varDateTime,format));

...