php - Compare BST date with UTC + 1 date -
i have string date : 2016-02-12 19:30:00
this date in bst timezone , need compare date today date. french it's utc + 1.
what's solution ? if add 1 hour bst date, correct ? need convert bst utc + 1, or utc + 1 bst ?
for retrieve today : $today = date("y-m-d h:i:s");, , compare 2 dates :
if(date('y-m-d h:i:s', strtotime($mybstdate)) >= $today) for me wrong, there offset of 1 hour.
what's correct way ? !
legacy date functions not particularly suitable date math time zone information. it's rather straightforward though if use objects:
$date = new datetime('2016-02-12 19:30:00 bst'); if ($date>=new datetime) { }
Comments
Post a Comment