Page 1 of 1

date ()

Posted: Wed Nov 27, 2002 8:23 pm
by thoughtriot
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?

Posted: Wed Nov 27, 2002 8:49 pm
by BigE
date() has a nifty little function where you can specify a timestamp for it to create a date uppon. This should work for you.

Code: Select all

date ("m.d.y h:i a", time() -10800);
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.