xref: /PHP-7.1/ext/date/tests/strtotime-mysql.phpt (revision 610c7fbe)
1--TEST--
2strtotime() and mysql timestamps (32 bit)
3--SKIPIF--
4<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
5--FILE--
6<?php
7date_default_timezone_set('UTC');
8
9/* Format: YYYYMMDDHHMMSS */
10$d[] = '19970523091528';
11$d[] = '20001231185859';
12$d[] = '20800410101010'; // overflow..
13
14foreach($d as $date) {
15	$time = strtotime($date);
16
17	if (is_integer($time)) {
18		var_dump(date('r', $time));
19	} else {
20		var_dump($time);
21	}
22}
23?>
24--EXPECT--
25string(31) "Fri, 23 May 1997 09:15:28 +0000"
26string(31) "Sun, 31 Dec 2000 18:58:59 +0000"
27bool(false)
28