From a7e8e9aa7ddfd9f17e7bb3dc4e4c12429a7eec21 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Mon, 7 Sep 2009 21:31:45 +0200 Subject: [PATCH] doc: ported and updated old doc for Date#toJSON. --- src/lang/date.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lang/date.js b/src/lang/date.js index b50a92b..e67338b 100644 --- a/src/lang/date.js +++ b/src/lang/date.js @@ -8,6 +8,15 @@ * Date#toJSON() -> String * * Produces a string representation of the date in ISO 8601 format. + * The time zone is always UTC, as denoted by the suffix "Z". + * + * ### Example + * + * var d = new Date(1969, 11, 31, 19); + * d.getTimezoneOffset(); + * //-> -180 (time offest is given in minutes.) + * d.toJSON(); + * //-> '"1969-12-31T16:00:00Z"' **/ Date.prototype.toJSON = function() { return '"' + this.getUTCFullYear() + '-' +