0

I'm using these two lines:

$expires = strtotime( $_POST['expire_date']);
if($expires < time())

to test the time in the name=expire_date form against GMT time. But no matter what I do my expire date time is 5 hours off. I'm in GMT -5, so I'm trying to adjust the top line:

$expires = strtotime( $_POST['expire_date']) - (( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ));

But it's not working. Any ideas for correct GMT offset handling in Wordpress?

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.