Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2023-09-15 08:01:13
forward
1191 people have browsed it

如何借助 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)
Copy after login

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
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!