Is anyone know how to get offset value of tzfile in Javascript?
functiongetTime(name){
var timeFile =newSCFile("tzfile");
var rc=timeFile.doSelect("name=\""+name+"\"");
print("conversion:"+timeFile.conversion_type[0]);
print("conversion offset:"+timeFile.conversion_type[0].offset);
return rc;
}
print(getTime("Canada/Eastern"));
The result is:
conversion offset:Fri Dec 17 -0001 14:00:00 GMT-0500 (Eastern Standard Time)
conversion:[C++ object Datum] @0x01594330 - {['-05:00:00', "AST"]}
How I can get -05:00:00?


Reply With Quote
Bookmarks