Comparing two date/time is giving me the incorrect response

Hello all!

I am trying to compare two time values and am having problems getting the result I want I need for this to be exact as when certain time arrives a function should be disabled, this is the way I am doing it


$race = array (
	'params'=>'{"week":"29","timezone":"CDT"}',
	'race_starts'=>'2012-05-19',
	'race_ends'=>'13:00:00'
);
$timezones = array(
	'AST'=> array ('id'=>'AST', 'value'=>'America/Puerto_Rico'),
	'EDT'=> array ('id'=>'EDT','value'=>'America/New_York'),
	'CDT'=> array ('id'=>'CDT','value'=>'America/Chicago'),
	'MDT'=> array ('id'=>'MDT','value'=>'America/Boise'),
	'MST'=> array ('id'=>'MST','value'=>'America/Phoenix'),
	'PDT'=> array ('id'=>'PDT','value'=>'America/Los_Angeles'),
	'AKDT'=> array ('id'=>'AKDT','value'=>'America/Juneau'),
	'HST'=> array ('id'=>'HST','value'=>'Pacific/Honolulu'),
	'ChST'=> array ('id'=>'ChST','value'=>'Pacific/Guam'),
	'SST'=> array ('id'=>'SST','value'=>'Pacific/Samoa'),
	'WAKT'=> array ('id'=>'WAKT','value'=>'Pacific/Wake'),
	'PND'=> array ('id'=>'PND','value'=>'Pending')
);	
function allowRiderSelect ( $race, $tz ) {
	$race['params'] = json_decode( $race['params'], true );
	date_default_timezone_set($tz[$race['params']['timezone']]['value']);
	$racelocktime = strtotime ( $race['race_starts'] . ' ' . $race['race_ends'] );
	if ( $racelocktime > strtotime ( date('Y-m-d h:i:s') ) ){
		return true;
	} else {
		return false;
	}
}
allowRiderSelect( $race, $timezones );

The time has to respect the timezone that is why I set the timezone but always the lock time, if it is during the same day is bigger than the current time so today at 5pm if the race is set for locking at today at 4 pm the function is not locked can someone help me out!!!

There is like a 12 hour difference on this, if I set the values to that it will not work why would it have a 12 hour difference?

I ended up changing it for this


function allowRiderSelect ( $race, $tz ) {
	$race['params'] = json_decode( $race['params'], true );
	date_default_timezone_set($tz[$race['params']['timezone']]['value']);
	$locktime = new DateTime ( $race['race_starts'] . ' ' . $race['race_ends'] );
	$now = new DateTime ( 'now' );
	if ( $now > $locktime ) {
		return true;
	} else {
		return false;
	}
}

but I am still wondering why there was a 12 hour difference