linux - Javascript Date object returns wrong date -
i have trouble js date object.
i working on timezone settings. creating zic file (like /usr/share/zoneinfo/europe/paris) i'm able manual set local date time parameters. tests, i'm doing offet of 1 year. works fine on system side :
date -u ==> thu jun 4 10:18:27 utc 2015 date ==> sat jun 4 12:18:29 bst 2016
but
console.debug(new date()) ==> sun may 10 2015 13:50:27 gmt-k631 (bst)
does have seen such strange behavior , date object ?
thanks
thom
the browser date object using clock determine time. if set location ( +2 hours, -5 hours etc ) there going difference between system side , client side.
you can "normalize" date greenwich time ( +0 ) , set time object based on current offset , desired offset.
Comments
Post a Comment