There is not functions yet available to display the JS date object in the ISO UTC format, although there is a workaround.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SwConvertDateTimeToXml(dateTime,TIMEZONE_OFFSET) { | |
var offset = (TIMEZONE_OFFSET < 0) ? -TIMEZONE_OFFSET : TIMEZONE_OFFSET; | |
var timezoneOffsetHours = Math.floor(offset / 60); | |
var timezoneOffsetMinutes = offset - timezoneOffsetHours * 60; | |
var s = dateTime.getYear().toString() + "-" + | |
SwGetFormattedDatePart(dateTime.getMonth() + 1) + "-" + | |
SwGetFormattedDatePart(dateTime.getDate()) + "T" + | |
SwGetFormattedDatePart(dateTime.getHours()) + ":" + | |
SwGetFormattedDatePart(dateTime.getMinutes()) + ":" + | |
SwGetFormattedDatePart(dateTime.getSeconds()) + | |
((ORG_TIMEZONE_OFFSET < 0) ? "-" : "+") + | |
SwGetFormattedDatePart(timezoneOffsetHours) + ":" + | |
SwGetFormattedDatePart(timezoneOffsetMinutes); | |
return s; | |
} | |
function SwGetFormattedDatePart(value) { | |
return (value < 10) ? ("0" + value.toString()) : value.toString(); | |
} |