suzzane2020 Posted March 29, 2007 Share Posted March 29, 2007 Hi, I have a script to generate the local time. My local time here is ISD 6:50pm. This is the script $timestamp = time() ; $hr=time(); echo $hr; $current_time=strftime("%I:%M %p",$timestamp) ; but i get a time as 1:10pm aand so .not the rite time. is there anythn wrong? plz help Quote Link to comment Share on other sites More sharing options...
spamoom Posted March 29, 2007 Share Posted March 29, 2007 If it was me, I would just +5 to the hour ^^ Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 Check to see if your locale is set correctly. If it is, ensure that the server has the correct time set (for the time zone it is located in, not yours). Also ensure that the server is aware of what time zone it is in. http://www.php.net/setlocale Quote Link to comment Share on other sites More sharing options...
suzzane2020 Posted March 29, 2007 Author Share Posted March 29, 2007 my computer time is set with the server and it denotes the correct time. but the time function gets me another one Quote Link to comment Share on other sites More sharing options...
suzzane2020 Posted March 29, 2007 Author Share Posted March 29, 2007 How do i change the local timezone in phpini settings. The prob mentioned above has nt been solved yet. the time function gives me a time 5 hrs back. the time on my system is correct I have tried the same function at my workplace and it gives me the rite time. But when i use it at home on xampp it gives te wrong time plz help Quote Link to comment Share on other sites More sharing options...
per1os Posted March 29, 2007 Share Posted March 29, 2007 I would check your apache settings(httpd.conf), it may be in there as the time() function goes off of what the server has stated (Apache). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.