21
20
INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
22
21
SELECT ts,from_unixtime(ts) FROM t1;
23
22
ts from_unixtime(ts)
24
1035673200 2002-10-27 01:00:00
25
1035680400 2002-10-27 02:00:00
26
1035684000 2002-10-27 03:00:00
27
1035680400 2002-10-27 02:00:00
28
1035673200 2002-10-27 01:00:00
29
1035680400 2002-10-27 02:00:00
30
1048986000 2003-03-30 03:00:00
31
1048986000 2003-03-30 03:00:00
32
1048989599 2003-03-30 03:59:59
33
1048989601 2003-03-30 04:00:01
23
1035680400 2002-10-27 01:00:00
24
1035684000 2002-10-27 02:00:00
25
1035687600 2002-10-27 03:00:00
26
1035684000 2002-10-27 02:00:00
27
1035680400 2002-10-27 01:00:00
28
1035684000 2002-10-27 02:00:00
29
1048993199 2003-03-30 02:59:59
30
1048993200 2003-03-30 03:00:00
31
1048996799 2003-03-30 03:59:59
32
1048996801 2003-03-30 04:00:01
35
34
CREATE TABLE t1 (ts timestamp);
36
35
INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'),
37
('2003-03-30 02:59:59'),
38
36
('2003-03-30 03:00:00');
40
Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2
42
select unix_timestamp('1970-01-01 01:00:00'),
43
unix_timestamp('1970-01-01 01:00:01'),
44
unix_timestamp('2038-01-19 04:14:07'),
45
unix_timestamp('2038-01-19 04:14:08');
46
unix_timestamp('1970-01-01 01:00:00') unix_timestamp('1970-01-01 01:00:01') unix_timestamp('2038-01-19 04:14:07') unix_timestamp('2038-01-19 04:14:08')
38
select unix_timestamp('1970-01-01 00:00:00');
39
unix_timestamp('1970-01-01 00:00:00')
41
select unix_timestamp('1970-01-01 00:00:01');
42
unix_timestamp('1970-01-01 00:00:01')
44
select unix_timestamp('2038-01-19 03:14:07');
45
unix_timestamp('2038-01-19 03:14:07')
47
select unix_timestamp('2038-01-19 03:14:08');
48
ERROR HY000: Received an invalid value '2038-01-19 03:14:08' for a UNIX timestamp.