literal dates

From: Date: Fri, 03 Sep 2004 05:45:40 +0000
Subject: literal dates
Groups: php.general 
Request: Send a blank email to php-general+get-195681@lists.php.net to get a copy of this message
Hi all, I'm really sure how to tackle this. Part of a CMS I'm building is an events calendar. The events in question can be in any part of the world (in any timezone) and the date & time the user enters for the event is considered to be the local time of that event. So when I enter 2004-09-03 23:00, I'm indicating the event is on September 9th 2004 @ 11pm IN THAT LOCATION, not in GMT (as opposed to all other dates on the site, which I record the GMT date-time and the offset based on the current timezone of the application). Basically, the problem is that I want to be able to manipulate and work with the event date. It's relatively easy to get "March" from "03", but it's impossible to get "Wednesday", as far as I can tell... If I use strtotime(), I'm handed back a GMT timestamp, whereas I need a *local* timestamp. All I can think of here is to record/know the Timezone of every event, but that puts a rather large burden on the user (to get it right), so that I can apply it to the UNIX timestamp. Am I missing something here, I do I really need to know the GMT offset of every event? --- Justin French http://indent.com.au

« previous php.general (#195681) next »