By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Time Help

P: n/a
Hello,
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.
Dec 13 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
gmstrftime()
http://www.php.net/gmstrftime
Dec 13 '07 #2

P: n/a
On Thu, 13 Dec 2007 15:29:19 -0800 (PST), macca
<pt*******@googlemail.comwrote:
>gmstrftime()
http://www.php.net/gmstrftime

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

Dec 14 '07 #3

P: n/a
John schreef:
On Thu, 13 Dec 2007 15:29:19 -0800 (PST), macca
<pt*******@googlemail.comwrote:
>gmstrftime()
http://www.php.net/gmstrftime


I just need an example as I looked at the site and I'm not good with
PHP.
The example is quite obvious, what is it that you don't understand?
JW
Dec 14 '07 #4

P: n/a
John wrote:
( "F j, Y g:ia T", $row[date] )
What do I change to get it to -8?

( "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 2.6.17.14-mm-desktop-9mdvsmp, up 6 days, 20:54.]

Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/1...tunes-sharing/
Dec 14 '07 #5

P: n/a

Thank you Toby for the example.

This is exactly what I needed.
>
( "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.
Dec 14 '07 #6

P: n/a
One more quick question. How do I make say PST instead of GMT?
>John wrote:
>( "F j, Y g:ia T", $row[date] )
What do I change to get it to -8?


( "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.
Dec 14 '07 #7

P: n/a
My god man RTFM!

You could use

timezone_offset_get()

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

This discussion thread is closed

Replies have been disabled for this discussion.