pocobueno1388 Posted October 29, 2006 Share Posted October 29, 2006 Hello everyone. I was just wondering how I would take a timestamp from the database like this: 16:48:11and change it to central time (US). I have played with the date() function, but I couldn't figure it out. I also don't want it to appear in military time.I appreciate all your help ^^ Thanks. Quote Link to comment Share on other sites More sharing options...
pendelton Posted October 29, 2006 Share Posted October 29, 2006 date("h:i:s");Use putenv("TZ=GB"); to set your timezone (you will need to replace GB with UST or similar). Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 29, 2006 Author Share Posted October 29, 2006 I'm sorry, I don't understand the second part of what you said 0_0 Quote Link to comment Share on other sites More sharing options...
pendelton Posted October 29, 2006 Share Posted October 29, 2006 I assume that the timezone on you machine is not central time US? If it is then you don't need the putenv. However, the server isn't using central US time you will need to write to code as follows:Use [code]<?putenv("TZ=US");print date("h:i:s");?>[/code]Try the above then chage "TZ=US" to "TZ=GB" (TZ stands for timezone). Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 29, 2006 Author Share Posted October 29, 2006 That printed the time out as 3:00 when it was 9:00....so it didn't work. I tried this too:[code]<?putenv("TZ=US/central");print date("h:i:s");?>[/code] Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 29, 2006 Author Share Posted October 29, 2006 Anyone else have any ideas? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted October 30, 2006 Author Share Posted October 30, 2006 Hmmm...no one? 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.