Home >Database >Mysql Tutorial >How to know the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?

How to know the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?

WBOY
WBOYforward
2023-09-15 08:01:131321browse

如何借助 MySQL FROM_UNIXTIME() 函数了解 TIMESTAMP 数据类型的起始范围?

As we all know, this function converts seconds to TIMESTAMP value. So, by providing 0 seconds as argument, it will give us the starting range of the TIMESTAMP data type.

mysql> Select FROM_UNIXTIME(0);
+-------------------------+
| FROM_UNIXTIME(0)        |
+-------------------------+
| 1970-01-01 05:30:00     |
+-------------------------+
1 row in set (0.00 sec)

Now if we change the parameter from 0 to 60 seconds then the time will change by 01 minutes.

mysql> Select FROM_UNIXTIME(60);
+-------------------------+
| FROM_UNIXTIME(60)       |
+-------------------------+
| 1970-01-01 05:31:00     |
+-------------------------+
1 row in set (0.00 sec)

The above is the detailed content of How to know the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete