SELECT FROM_UNIXTIME(event_time) AS formattedEventTime FROM events;
If a timestamp is stored as an
INT in a MySQL database table, in some cases it may be necessary to convert it to a normal date string.
FROM_UNIXTIME function returns a representation of unix_timestamp as a datetime or character string value.
Please note that the value returned is expressed using the session time zone.
- Convert Unix timestamp to human readable date in MySQL
- Count total rows by year in MySQL
- Convert INT to DATETIME in MySQL
- Select year from a Unix timestamp in MySQL
- Group by year of Unix timestamp in MySQL
- Get current date in MySQL
- Get current year in MySQL
- Extract year from a date in MySQL
- Get last 30 days records in MySQL