datetime - How do I convert a date/time to HST in JavaScript? -
trying convert date string hst time, not work.
relevant code:
var minutes_in_milli = 60000, hours_in_milli = 3600000, utc2hst_offset = 10, date1 = new date('2013-05-31t00:00:00z'), utc1 = date1.gettime() + (date1.gettimezoneoffset() * minutes_in_milli), hstdate1 = utc1 - (hours_in_milli * utc2hst_offset);
i go out on limb , problem introducing both known fixed offset (10 hours), , derived offset gettimezoneoffset()
.
you don't want:
utc1 = date1.gettime() + (date1.gettimezoneoffset() * minutes_in_milli)
from variable name gave it, assume want utc timestamp, do:
utc1 = date1.gettime()
but without additional information requested in comments, can't sure after. please update question , modify answer necessary.
Comments
Post a Comment