Jump to content

date() function returns wrong time


mhd_arif123

Recommended Posts

You can use date_default_timezone_set to switch between timezones. Pass the timezone information. If you are using PHP 5>=5.2, please use the more advanced DateTime class.

 

example

<?php

echo date('h:i:s')."\n";

date_default_timezone_set('Europe/Paris');

echo date('h:i:s')."\n";

date_Default_timezone_set('UTC');

echo date('h:i:s')."\n";

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.