Time Help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have this script and it shows GMT time and I need it to show -8 GMT
for PST time.

Here is the code that needs changing.

( "F j, Y g:ia T", $row[date] )

What do I change to get it to -8?

Any help would be appreciated.

Re: Time Help



Re: Time Help

On Thu, 13 Dec 2007 15:29:19 -0800 (PST), macca

Quoted text here. Click to load it

I just need an example as I looked at the site and I'm not good with

Re: Time Help

John schreef:
Quoted text here. Click to load it

The example is quite obvious, what is it that you don't understand?


Re: Time Help

John wrote:
Quoted text here. Click to load it

( "F j, Y g:ia T", $row[date] - 8*3600 )

i.e. subtract 8 hours (an hour is 3600 seconds) from the time before  
displaying it.  

There might be some funniness around daylight savings, but there's always  
funniness around then. This is why I think daylight savings, and perhaps  
even time zones as a whole, should be abolished. Everyone should just use  
UTC for everything all the time.

Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux, up 6 days, 20:54.]

                      Sharing Music with Apple iTunes

Re: Time Help

Thank you Toby for the example.  

This is exactly what I needed.
Quoted text here. Click to load it

Re: Time Help

One more quick question. How do I make say PST instead of GMT?

Quoted text here. Click to load it

Re: Time Help

My god man RTFM!

You could use


The examples are on the page http://www.php.net/timezone_offset_get ()
so i cant be bothered typing it out for you.

Site Timeline