

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I convert the epoch stored in MySQL table into readable dates?
To illustrate it we are using the following example of a table named ‘vistors’ which have the epoch as follows −
mysql> Create table visitors(userid int not null, name varchar(20), epoch int NOT NULL); Query OK, 0 rows affected (0.42 sec) mysql> Insert into visitors Values(1, 'Gaurav', 1358658942); Query OK, 1 row affected (0.04 sec) mysql> Insert into visitors Values(2, 'Raman', 1358659585); Query OK, 1 row affected (0.04 sec) mysql> Select userid, name, FROM_UNIXTIME(epoch) from visitors; +--------+--------+----------------------+ | userid | name | FROM_UNIXTIME(epoch) | +--------+--------+----------------------+ | 1 | Gaurav | 2013-07-24 16:05:42 | | 2 | Raman | 2013-07-24 16:16:25 | +--------+--------+----------------------+ 2 rows in set (0.00 sec)
- Related Questions & Answers
- How can I convert 1st January of the current year into epoch?
- Convert UNIX timestamp into human readable format in MySQL?
- How to apply EXTRACT() function on the dates stored in MySQL table?
- In MySQL, how can I convert a number of seconds into TIMESTAMP?
- How can I convert Python strings into tuple?
- How can I get days since epoch in JavaScript?
- How can I get seconds since epoch in JavaScript?
- How can I create a stored procedure to insert values in a MySQL table?
- How can I create a stored procedure to update values in a MySQL table?
- How to apply EXTRACT() function with WHERE Clause on the dates stored in MySQL table?
- How can I create a stored procedure to delete values from a MySQL table?
- How I can convert a Python Tuple into Dictionary?
- How can I create a MySQL stored procedure that returns multiple values from a MySQL table?
- How can I delete MySQL temporary table?
- Perform MySQL SELECT on dates inserted into the table as VARCHAR values
Advertisements