Re: Date class - NY Time

From: Date: Wed, 01 Sep 2004 04:41:08 +0000
Subject: Re: Date class - NY Time
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14362@lists.php.net to get a copy of this message
when it should produce: Sydney: 2004-09-01 13:15:11 pm NY: 2004-08-31 23:15:11 pm Is there a bug?
Tried this: $id = "Australia/ACT"; $today = date("Y-m-d H:i:s"); $date = new Date($today); $date->setTZbyID($id); $ny = new Date_Timezone("America/New_York"); print "Sydney: " . $date->format("%Y-%m-%d %H:%M:%S %p") . "<br>\n"; $date->convertTZ($ny); print "NY: " . $date->format("%Y-%m-%d %H:%M:%S %p") . "<br>\n"; Now produces: Sydney: 2004-09-01 14:36:59 pm NY: 2004-08-31 23:36:59 pm NY should be 2004-08-31 24:36:59 pm (or is it am?) Close but no cigar. I was hoping to get the date without having to set the timezone for the current server, but I'll code it in if I have to. Leonie

« previous php.pear.general (#14362) next »