Re: Date class - NY Time
| From: | Leonie | Date: | Wed, 01 Sep 2004 03:02:36 +0000 |
| Subject: | Re: Date class - NY Time | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14360@lists.php.net to get a copy of this message | ||
Leonie wrote:
I want to write a function that will always return the time in New York.
Is this the correct way?
$date = new Date();
$date->setTZbyID("EST");
echo $date->getDate();
Trawling through the code it seems the way to do it, but it just returns the date of my server.
Any ideas why?
Leonie
Worked it out:
$date= new Date();
$ny_tz= new Date_Timezone("America/New_York");
$date->converttz($ny_tz);