RE: [PHP] local time v.s. server time
| From: | Don Read | Date: | Sat, 25 Aug 2001 05:15:10 +0000 |
| Subject: | RE: [PHP] local time v.s. server time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64402@lists.php.net to get a copy of this message | ||
On 25-Aug-2001 Joe Sheble \(Wizaerd\) wrote:
> Alas, I don't have this luxury since it's not my server, but one that is
> hosted with a web hosting provider. They control the setup and
> configuration of the machines... since it's a shared server I doubt I'll
> convince them to set the timezone to my location, thus throwing everyone
> else on the same server out of whack...
>
> I can use the putenv() function though for use in PHP and then when saving
> the date and time into mySQL actually use the PHP date and time functions
> instead of the mySQL Now() function...
Well, El-sucko.
You'll have to use INT for your DATETIME columns.
Then use mktime() to insert the NOW() value, & code around the MySQL
DATE_FORMAT, DATE_SUB, & DATE_ADD functions and, umm, TIMESTAMP,
UNIX_TIME ...
See if your provider will start a separate server for you, rather than you
giving up most of the SQL date/time goodies ?
>
> Where would I find the TZ codes to use for my area?
>
Prolly MST7MDT or PST8PDT.
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.