tags:

views:

65

answers:

3

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
+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
+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
thanks very much
jazzrai