How to show the time and data in the user's timezone? I don't know it at all! Can anyone teach me? Thanks!
cliffcc
0
Junior Poster
Recommended Answers
Jump to PostI use this code found from one forum.
Hope this helps you.<?php if (!isset($_POST["timezoneoffset"])){ ?> <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" id="time_form" name="time_form"> <script type="text/javascript"> tzo = - new Date().getTimezoneOffset()*60; document.write('<input type="hidden" value="'+tzo+'" name="timezoneoffset">'); </script> <input type="submit" value="Get Server Client TimeZone Difference" name="Ok"> </form> <?php }else{ …
All 4 Replies
vibhaJ
126
Master Poster
diafol
cliffcc
0
Junior Poster
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.