I have set a deadline in UTC, as shown below, and I\'m wondering what exactly the toLocaleString() method will do to it on user\'s local machines. For instance, will it account
We don't know what exactly the toLocaleString
method does (§15.9.5.5):
This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment’s current locale.
But yes, most implementations will consider DST if it is active in the current local timezone. For your example I'm getting "Mittwoch, 1. Mai 2013 18:15:00
" - CEST.
Will I need to insert additional code that checks where the user is, and then fixes the displayed time?
I think you can trust toLocaleString
- the browser should respect the user's settings. If you want to do it manually, check out timezone.js.