Can javascript be used to turn this time stamp {ts '2007-09-17 21:54:59'}
into the correct time for the "clients" time zone?
Thanks for your help!
Can javascript be used to turn this time stamp {ts '2007-09-17 21:54:59'}
into the correct time for the "clients" time zone?
Thanks for your help!
JavaScript does support the creation of a date object using a full date/time string as its parameter. You can then convert that into the local format in which date/time is displayed for that user. So something like:
That's different than adjusting the timestamp time (server time I assume) to the local time of the user though.Code:<script type="text/javascript"> var mydate=new Date("September 17, 2007 21:54:59") alert(mydate.toLocaleString()) </script>
Can javascript check to see what time zone or what the "time zone offset" is from "GMT" from the users browser?
If so, then I could store that as a cookie and then call on it later to adjust the time and date as needed.
Thanks again!
Bookmarks