locked
Why does date on web browser display one day less if timezone is changed ? RRS feed

  • Question

  • User1253338400 posted

    Hi ,

    I reside in the current timezone 

    (UTC + 10:00)  Canberra, Melbourne, Sydney

    but for experimentation and testing I have set my timezone to 

    (UTC + 12:00)  Auckland, Wellington

    Now if i select a date from a date time picker to lets say 10/27/2016 (MM/dd/yyyy)

    it will actually show 10/26/2016 when i have finished selecting.

    Why would this happen ?

    thanks

    Wednesday, October 19, 2016 2:06 AM

Answers

  • User1718973993 posted

    thats unusual cos here you are specifying the Timezone......

    these problems arise when you are take DateTime.Now cos sometime your server can be in other country and the functions usually takes the server time...say i am in India and my server is in Singapore then DateTime get varies by some margin....

    but here you are specifying the Time zone....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 3, 2016 7:38 AM

All replies

  • User1718973993 posted

    thats unusual cos here you are specifying the Timezone......

    these problems arise when you are take DateTime.Now cos sometime your server can be in other country and the functions usually takes the server time...say i am in India and my server is in Singapore then DateTime get varies by some margin....

    but here you are specifying the Time zone....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 3, 2016 7:38 AM
  • User1253338400 posted

    Hi ,

    thats correct thats what was puzzling. Also becuase it is a datetime , I was under the imopression the UI would just display wat the user selected

    thanks

    Monday, November 21, 2016 9:30 PM