This is a discussion on Time Help within the PHP Language forums, part of the PHP Programming Forums category; Hello, I have this script and it shows GMT time and I need it to show -8 GMT for PST ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
|
|
|||
|
On Thu, 13 Dec 2007 15:29:19 -0800 (PST), macca
<ptmcnally@googlemail.com> wrote: >gmstrftime() > > >http://www.php.net/gmstrftime I just need an example as I looked at the site and I'm not good with PHP. |
|
|||
|
John schreef:
> On Thu, 13 Dec 2007 15:29:19 -0800 (PST), macca > <ptmcnally@googlemail.com> wrote: > >> 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 |
|
|||
|
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/ |
|
|||
|
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. |
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|