On 03 September 2004 06:46, Justin French wrote:

> If I use strtotime(), I'm handed back a GMT timestamp,
> whereas I need a
> *local* timestamp.

No such thing as a *local* timestamp.  UNIX timestamps are in GMT by definition -- 
it's the functions that work with them that do the timezone adjustments.  (Compare 
mktime(12,0,0,9,1,2004) and gmmktime(12,0,0,9,1,2004), for example.)

> Am I missing something here, I do I really need to know the
> GMT offset
> of every event?

My opinion on that would be a "Yes", if you're storing events that can take place in 
multiple timezones.

Your only other option, which would effectively give you your "local timestamp", is to 
treat every date/time entered as if it were GMT, and always use the gm*() functions 
(or force-add a "GMT" marker to strings passed to strtotime()).  That way, no timezone 
adjustments are ever done, and any one user sees times as originally entered -- but 
you can't do cross-timezone comparisons because they're not timezone adjusted.  Oh, 
and you probably still need to do manual tracking of DST.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to