Jump to content

Detect If Daylight Savings Enabled


JustinK101

Recommended Posts

a quick google says it is not possiable with PHP and gave me this javascript

<script type="text/javascript">
document.getElementById('timezone').value = new Date().getTimeZoneOffset(); // this should all be in one line
</script>

 

Scott.

That built in JS function I guess has issues. FYI to others, this guy wrote a nice script, which works through-out the world.

 

http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/#comment-233

The script at that link will detect the timezone, but assuming you want that information on the server (you did ask in a php forum), it still needs to be sent to the server. You can use a modified version of the code at this link to get any information available in the browser to a php script on the server - http://www.php.net/manual/en/faq.html.php#faq.html.javascript-variable

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.