$user_tz =" 0.00"; // GMT London
$user_offset = $user_tz * 3600; // Number of hours X number of minutes X number of seconds
//This gets today's date
$timestamp = time();
$local_timestamp = $timestamp + $user_offset;
//This puts the day, month, and year in seperate variables
$day = date('d', $local_timestamp) ;
$month = date('m', $local_timestamp) ;
$year = date('Y', $local_timestamp) ;
echo $day;
echo $month;
echo $year;
I get the correct date in the day but when it's 12am and it's supposed to change to the 19th of feb, it stays on 18th of february. I have stayed up late just to find out if it works past midnight. One more thing, the server is hosted in the Us and I live in the Uk, is ita problem. Or is there a better way to get different timezones?