Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Doc a couple error handling things

...

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:add("2011W206T1345-0600",{"days": -65})      # 2011-03-17T13:45:00Z
time:add("2010-08-08",{"weeks": 5})              # 2010-09-12T00:00:00Z
time:add("67342",{"hours": 3})                    # NOT SUPPORTED YET
                                                  # 1967-12-08T04:00:00Z
time:add("083023Z",{"minutes": 10})             # 2010-10-06T08:40:23Z
time:add("083023Z",{"seconds": 632})             # 2010-10-06T08:40:55Z
time:add("1970-01-01",{"seconds": 1286388924})    # 2010-10-06T18:15:24Z

Unrecognized time units are ignored. The exact rules can get complicated considering leap years, different month lengths, and adding (or subtracting) multiple units at once versus one after another. See http://momentjs.com/docs/#/manipulating/add/ (the time module uses a version above 2.18.0). UTC does not have daylight savings time.

...

Valid format arguments to strftime follow the POSIX strftime conventions. If the format string is invalid, the format string is returned as is.


Note

The third argument below is not yet implemented.

...