

- 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 to convert unix timestamp string to readable date in Python?
You can use the fromtimestamp function from the datetime module to get a date from a UNIX timestamp. This function takes the timestamp as input and returns the datetime object corresponding to the timestamp.
Exmaple
import datetime timestamp = datetime.datetime.fromtimestamp(1500000000) print(timestamp.strftime('%Y-%m-%d %H:%M:%S'))
Output
This will give the output −
2017-07-14 08:10:00
- Related Questions & Answers
- How to convert Python date to Unix timestamp?
- Convert UNIX timestamp into human readable format in MySQL?
- Convert MySQL Unix-Timestamp format to date format?
- Convert MySQL timestamp to UNIX Timestamp?
- Convert date string to timestamp in Python
- How to convert from Unix timestamp to MySQL timestamp value?
- How to convert MySQL datetime to Unix timestamp?
- Convert dd/mm/yyyy string to Unix timestamp in MySQL?
- How to convert a Unix timestamp to time in JavaScript?
- MySQL - Convert YYYY-MM-DD to UNIX timestamp
- How to convert date to timestamp in MongoDB
- Convert MM/DD/YY to Unix timestamp in MySQL?
- Convert buffer to readable string in JavaScript?
- How to convert timestamp string to datetime object in Python?
- Java Program to convert millisecond to readable string
Advertisements