
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is the difference between UNIX TIMESTAMPS and MySQL TIMESTAMPS?
In MySQL, UNIX TIMESTAMPS are stored as 32-bit integers. On the other hand MySQL TIMESTAMPS are also stored in similar manner but represented in readable YYYY-MM-DD HH:MM:SS format.
Example
mysql> Select UNIX_TIMESTAMP('2017-09-25 02:05:45') AS 'UNIXTIMESTAMP VALUE'; +---------------------+ | UNIXTIMESTAMP VALUE | +---------------------+ | 1506285345 | +---------------------+ 1 row in set (0.00 sec)
The query above shows that UNIX TIMESTAMPS values are stored as 32 bit integers whose range is same as MySQL INTEGER data type range.
mysql> Select FROM_UNIXTIME(1506283345) AS 'MySQLTIMESTAMP VALUE'; +----------------------+ | MySQLTIMESTAMP VALUE | +----------------------+ | 2017-09-25 01:32:25 | +----------------------+ 1 row in set (0.00 sec)
The query above shows that MySQL TIMESTAMPS values are also stored as 32 bit integers, but in a readable format, whose range is same as MySQL TIMESTAMP data type range.
- Related Articles
- MySQL difference between two timestamps in Seconds?
- Difference between two timestamps in seconds in MySQL?
- Get the difference between two timestamps in seconds in MySQL?
- Find the difference between two timestamps in days with MySQL
- Python program to find difference between two timestamps
- Finding difference in Timestamps – Python Pandas
- How to compare timestamps in MySQL?
- How to get time difference between two timestamps in seconds?
- How to get the seconds and minutes between two Instant timestamps in Java
- How to get the duration between two Instant timestamps in Java
- How to apply NOW() to timestamps field in MySQL Workbench?
- How to get current timestamp and relative timestamps in PostgreSQL?
- Difference between Linux and Unix
- Difference between GNU and Unix
- Compare specific Timestamps for a Pandas DataFrame – Python

Advertisements