Commit 63cdd94a authored by Tristan Cavelier's avatar Tristan Cavelier

metadata.rst w3c get date function updated

parent 193bf84d
...@@ -437,7 +437,7 @@ W3C Date function ...@@ -437,7 +437,7 @@ W3C Date function
*/ */
function getW3CDate(use_utc) { function getW3CDate(use_utc) {
var d = new Date(), offset; var d = new Date(), offset;
if (use_utc === true) { if (use_utc) {
return d.toISOString(); return d.toISOString();
} }
offset = - d.getTimezoneOffset(); offset = - d.getTimezoneOffset();
...@@ -449,9 +449,9 @@ W3C Date function ...@@ -449,9 +449,9 @@ W3C Date function
d.getMinutes() + ":" + d.getMinutes() + ":" +
d.getSeconds() + "." + d.getSeconds() + "." +
d.getMilliseconds() + d.getMilliseconds() +
(offset < 0 ? "-" : "+") + (offset < 0 ?
(offset / 60) + ":" + "-" + parseInt(-offset / 60, 10) + ":" + (-offset % 60) :
(offset % 60) "+" + parseInt(offset / 60, 10) + ":" + (offset % 60))
).replace(/[0-9]+/g, function (found) { ).replace(/[0-9]+/g, function (found) {
if (found.length < 2) { if (found.length < 2) {
return '0' + found; return '0' + found;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment