<?php date_default_timezone_set( 'UTC' ); define( "TIMESTAMP_FORMAT", "Y-m-d G:i:s" ); $aString = "2017-03-01 23:11:16"; echo "String to convert: ". $aString ."\r\n"; $currentTime = date( TIMESTAMP_FORMAT ); echo "Current Time: ". $currentTime."\r\n"; $dateToCheck = new DateTime($aString); echo "Date To Check: ". $dateToCheck->format(TIMESTAMP_FORMAT)."\r\n"; if($dateToCheck < $currentTime) { echo 'Date is in the past'; } else { echo 'Date is in the future'; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`