Re: How do I get the local date & time
| From: | Seth Northrop | Date: | Fri, 05 Jan 2001 08:41:30 +0000 |
| Subject: | Re: How do I get the local date & time | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32850@lists.php.net to get a copy of this message | ||
> I am trying to print to the browser the current date and time. The problem
> is, I am in New Zealand and the ISP i use is in USA.
You could use putenv("TZ=<your timezone here>");
This will force the server through the duration of your script to think it
is a specific timezone.
For example:
# Make me GMT
putenv("TZ=Greenwich");
See:
http://www.php.net/manual/function.putenv.php
Or some previous discussion on the topic:
http://marc.theaimsgroup.com/?l=php-general&m=97566467632187&w=2
If you want this to change for all of your users then you need to build
some form of database which stores user info / timezone data and work from
there.
Hope this helps,
Seth