Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range of values returned by date("O") 1

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi there,

Does anyone know the range of values returned by the following PHP call:
Code:
date("O");
I would think it should be -1200 to +1200, but I can't be certain.

If you could reference your answer that would be most helpful.

Many thanks in advance!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
In principle the furthest east from Greewnwich is actually +14:00 (Kiritibati) and -12 for west of Greenwich (link)

so the php answer will depend on whether your current timezone database supports each of the edge cases. PHP says that it supports Pacific/Kiritmati (here) but it is not clear as to whether Kiritimati = Kiritibati. I can't get any leads on going the other way, short of running a script to test each supported timezone. and i can't find any neat way of automating the iteration through each time zone.

i guess you could also test by specifying the offset manually.

 
Thanks for those links Justin.

I've just noticed that the following range is given in the PHP Manual for "Timezone offset in seconds" i.e. a call to date("Z"):
-43200 through 50400 [seconds]
...which equates to -12:00 to +14:00


Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
that's what I love about php. the manual is so good. miles ahead of other language resources imo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top