- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of MySQL FROM_UNIXTIME() function?
MySQL FROM_UNIXTIME() function is used to return the date/datetime from a version of Unix timestamp. The format of return value would be either ‘YYYY-MM-DD HH:MM:SS’ or ‘YYYYMMDDHHMMSS.uuuuuu’ depending upon the context of the function i.e. whether the context is numeric or string.
Following is the syntax for FROM_UNIXTIME −
FROM_UNIXTIME(unix_timestamp, [format])
Here unix_timestamp is the value of Unix timestamp and format includes the format string in which we want to return the value.
Example
mysql> Select FROM_UNIXTIME(1555033470); +---------------------------+ | FROM_UNIXTIME(1555033470) | +---------------------------+ | 2019-04-12 07:14:30 | +---------------------------+ 1 row in set (0.00 sec)
- Related Articles
- In MySQL, how can we use FROM_UNIXTIME() function with format string?
- How to use MySQL FROM_UNIXTIME() function to return datetime value in numeric format?
- What is the use of MySQL SUBSTRING_INDEX() function?
- What is the use of MySQL UNHEX() function?
- What is the use of MySQL CHAR() function?
- What is the use of MySQL GET_FORMAT() function?
- What is the use of MySQL LAST_INSERT_ID() function?
- What is the use of MySQL CONCAT_WS() function?
- What is the use of MySQL TRUNCATE() function?
- What is the use of FIND_IN_SET () function in MySQL?
- What is the use of LOCATE() function in MySQL?
- On passing an out-of-range value in UNIX_TIMESTAMP() or FROM_UNIXTIME() function, what MySQL will return?
- What is the use of MySQL IFNULL() control flow function?
- What is the use of MySQL NULLIF() control flow function?
- How can we know about the starting range of TIMESTAMP data type with the help of MySQL FROM_UNIXTIME() function?

Advertisements