Jump to content

Changing the time from the database.


pocobueno1388

Recommended Posts

Hello everyone. I was just wondering how I would take a timestamp from the database like this:
16:48:11

and 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.
Link to comment
https://forums.phpfreaks.com/topic/25447-changing-the-time-from-the-database/
Share on other sites

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).


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.