Search the Community
Showing results for tags 'date/time'.
-
I would really appreciate help and I hope my problem can be solved easily. I am attempting to display the date/time based on the user's location. I have installed the timezone.js plugin for help as well. Is there a way to convert the Jquery variable that displays the users timezone location and insert it inside the PHP date_default_timezone_set? If there is an easier way to display the users timezone date and time please let me know otherwise this was the only solution I could find. Thanks in advanced... Here is my code Header <header> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script src="Time/detect_timezone.js"></script> <script src="Time/jquery.detect_timezone.js"></script> <script> $(document).ready(function(){ $('#tzvalue').set_timezone({'default' : 'America/Los_Angeles'}); }); </script> </header> Currently I have: (the timezone currently appears in the text box and below the textbox PHP echos the current time in my timezone) <input type="text" Name="Timezone" id="tzvalue"></input> <?php date_default_timezone_set("America/Chicago"); echo "The time is " . date("h:i:sa"); ?> What I want is: <?php date_default_timezone_set("$tzvalue"); echo "The time is " . date("h:i:sa"); ?>