date - Timezone for Plugin

admin2025-06-05  2

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?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749112633a316468.html

最新回复(0)