I have a given time and I'd like to confirm that is AFTER the current time.
$expires_epoch = strtotime($_POST['expiry']);
if($expires_epoch < current_time('mysql')){
...do stuff...
This snippet only works if I set my server to match my local time. That is to say that it's working in UTC time. Any ideas on what to fix? I've tried many alternative to current_time
.
I have a given time and I'd like to confirm that is AFTER the current time.
$expires_epoch = strtotime($_POST['expiry']);
if($expires_epoch < current_time('mysql')){
...do stuff...
This snippet only works if I set my server to match my local time. That is to say that it's working in UTC time. Any ideas on what to fix? I've tried many alternative to current_time
.
Please use DateTime::getTimestamp()
that returns unix timestamp.
If you want to format the date according to your time zone then you try this.
$datetime = new DateTime("now", new DateTimeZone('America/New York'));
echo $datetime ->format('m/d/Y, H:i:s');