date ()
Moderator: General Moderators
-
thoughtriot
- Forum Commoner
- Posts: 26
- Joined: Thu Nov 07, 2002 9:32 pm
date ()
I'm using the date () function for a news script, and I'm doing date ("m.d.y h:i a") and the hour is 3 ahead of mine because it's using the wrong time zone. How would I make it -3 hours?
date() has a nifty little function where you can specify a timestamp for it to create a date uppon. This should work for you.
What that does is use time() to take the current time then subtracts 10800 seconds from the current timestamp which will give you a timestamp that is 3 hours earlier. Hope that helps.
Code: Select all
date ("m.d.y h:i a", time() -10800);