<?php
$str = 'previous 22:30';
date_default_timezone_set('UTC');
var_dump(strtotime($str));
var_dump('22 ' . date('r', strtotime($str, time())));
var_dump('22 ' . date('r', strtotime($str, strtotime('2013-05-23 00:30'))));
var_dump('22 ' . date('r', strtotime($str, strtotime('2013-05-22 23:30'))));
var_dump('?? ' . date('r', strtotime($str, strtotime('2013-05-22 22:30'))));
var_dump('21 ' . date('r', strtotime($str, strtotime('2013-05-22 21:00'))));
- Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
- bool(false)
string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000"
string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000"
string(34) "22 Thu, 01 Jan 1970 00:00:00 +0000"
string(34) "?? Thu, 01 Jan 1970 00:00:00 +0000"
string(34) "21 Thu, 01 Jan 1970 00:00:00 +0000"
- Output for 5.0.0 - 5.0.5
- Fatal error: Call to undefined function date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255. - Output for 4.4.5 - 4.4.9
- Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
- Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- Fatal error: Call to undefined function: date_default_timezone_set() in /in/t0oie on line 3
preferences:
251.93 ms | 401 KiB | 325 Q