I have a radio site, and there is a module called "upNext" and that module will show my visitors when next DJ is coming.
BUT it's wrong time on the site.
http://sabfm.org//staff/_frontend/upnext.php is showing from 10:00 but my time in Sweden are soon 13:00. How do I fix that?
I have som code:
<?php
// Include the required glob.php file
require_once( "../_inc/glob.php" );
// Grab today's date using PHP date()
$today_date = date( 'N' );
// Grab the current hour
$now_hour = date( 'H' );
// Now we have the current hour, we add one to get the next hour
$next_hour = $now_hour + 1;
if ( $next_hour == 24 ) {
// It's midnight on the next day
$next_date = $today_date + 1;
$next_hour = "0";
}
else {
// It's the same day
$next_date = $today_date;
}
And in globe.php I have:
session_start();
putenv( "TZ=UTC" );
Can someone help me?
Set the timezone
date_default_timezone_set("Europe/Stockholm");
For more information about timezones, please checkout this link: PHP Timezones