I want to calculate my countrys((new zealand) local date and time in php but I dont know how to calculate. Please anyone can help me. thanks
+1
A:
http://us3.php.net/manual/en/function.date.php
If you are using PHP 5.1.0 or later you can also use the timestamp modifier to get the specific time you need.
Otherwise you just need to make the proper calculations to the local time you need against the server time.
BrandonCS
2009-10-22 18:41:56
+1
A:
You have to set default-time-zone and then date function will return you current date and time date_default_timezone_set
Xinus
2009-10-22 18:44:05
+1
A:
PHP >=5.2.0
$nz_time = new DateTime(null, new DateTimezone('Pacific/Auckland'));
echo $nz_time->format('Y-m-d H:i:s');
PHP 5
date_default_timezone_set('Pacific/Auckland');
echo date('Y-m-d H:i:s');
GZipp
2009-10-22 19:31:13
thanks very much
jazzrai
2009-10-22 21:42:09