Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarify where default time zone assumed

...

time:new() - returns a new RFC 3339 datetime string () from a string formatted as described in ISO8601 (v2000). It assumes UTC unless otherwise specified.

Code Block
languagejavascript
themeConfluence
time:new("2010-08-08")            # 2010-08-08T00:00:00Z (Date only—defaults to 00:00)
time:new("67342")                 # NOT SUPPORTED YET
                                  # 1967-12-08T00:00:00Z (Year DayOfYear)
time:new("2011W206T1345-0600")    # 2011-05-21T19:45:00Z (Year WeekOfYear DayOfWeek)
time:new("083023Z")               # 2010-10-05T08:30:23Z (Time only—defaults to today)

...

time:strftime() - returns a datetime string in a specified format following POSIX strftime conventions. It assumes the default time zone of the operating system running Node.

Code Block
languagejavascript
themeConfluence
time:strftime(xTime, "%F %T")          # 2010-10-06 18:15:24
time:strftime(xTime, "%F")             # 2010-10-06
time:strftime(xTime, "%T")             # 18:19:29
time:strftime(xTime, "%A %d %b %Y")    # Wednesday 06 Oct 2010
time:strftime(xTime, "%c")             # Oct 6, 2010 6:25:55 PM
time:strftime(xTime, "%s")             # 1286388924 -- seconds since epoch

...