I am testing my application in UK timezone (UTC) Dublin, Edinburgh, Lisbon, London. The DST (Daylight saving time) in UK starts on Last Sunday of March i.e. 27-Mar-2016. I am passing unix timestamp to Javascript Date object. It display normal date time but when UK DST is in effect, the time is one hour out
// s - unix timestamp // ausOffset - Australian Timezone Offset i.e. +10:00(Canberra, Melbourne, Sydney) // _clientOffset - client machine offset i.e. UK timezone (UTC) Dublin, Edinburgh, Lisbon, London var _date = new Date(s * 1000); var _Offset = ausOffset * 60 * 60000; var _dateTime = new Date(_date.getTime() + _Offset ); var _clientOffset = _date.getTimezoneOffset() * 60000; var _clientTime = new Date(_date.getTime() + _Offset + _clientOffset ); return _clientTime;
How can I avoid DST while creating datetime object in javascript. Thanks in advance
I tried to convert datetime in UTC timezone and added offset in it to get a specific date time.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)