| layout | api-command | ||||||
|---|---|---|---|---|---|---|---|
| language | JavaScript | ||||||
| permalink | api/javascript/iso8601/ | ||||||
| command | ISO8601 | ||||||
| io |
|
||||||
| related_commands |
|
Command syntax
{% apibody %} r.ISO8601(string[, {defaultTimezone:''}]) → time {% endapibody %}
Description
Create a time object based on an ISO 8601 date-time string (e.g. '2013-01-01T01:01:01+00:00'). RethinkDB supports all valid ISO 8601 formats except for week dates. Read more about the ISO 8601 format at Wikipedia.
If you pass an ISO 8601 string without a time zone, you must specify the time zone with the defaultTimezone argument.
Example: Update the time of John's birth.
r.table("user").get("John").update({birth: r.ISO8601('1986-11-03T08:30:00-07:00')}).run(conn, callback)