Problem with mysql getting time function unix_timestamp?
某草草
某草草 2017-05-27 17:39:04
0
2
695

Use mysql to get the milliseconds of the current date. If the date is too large, it will not be obtained.

SELECT unix_timestamp('2037-08-26 14:07:57')

SELECT unix_timestamp('2067-05-26 14:07:57')

I changed the year from 37 to 67, and the output became 0.

I have a sql statement that needs to compare time fields (accurate to seconds). The key code is as follows:

unix_timestamp( time ) between unix_timestamp( 'start ') and unix_timestamp( 'end' )

Personally, I think the time limit should be larger, but because of mysql restrictions, the maximum cannot exceed 2038,

Excuse me, is there any better way to solve this problem? Please give me some advice? Grateful……

某草草
某草草

reply all(2)
伊谢尔伦

The maximum value of INT type is: 2147483647 (signed)

The maximum value converted to time is: 2038/1/19 11:14:7

You enter 2067-05-26 14:07:57

How do you want Mysql to respond to you??

In terms of INT type, the timestamp will be used up at 2038/1/19 11:14:7...but there should be a new timestamp counting method by then...

仅有的幸福

So it can only be up to 2038...

https://en.m.wikipedia.org/wi...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!