

- 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
Getting formatted time in Python
You can format any time as per your requirement, but simple method to get time in readable format is asctime() −
Example
#!/usr/bin/python import time; localtime = time.asctime( time.localtime(time.time()) ) print "Local current time :", localtime
Output
This would produce the following result −
Local current time : Tue Jan 13 10:17:09 2009
- Related Questions & Answers
- Getting current time in Python
- How to get formatted date and time in Python?
- Formatted text in Linux Terminal using Python
- Formatted string literals (f-strings) in Python?
- Formatted Output in Java
- Formatted output in C#
- Formatted string literals in C#
- Formatted Strings Using Template Strings in JavaScript
- Getting calendar for a month in Python
- Python Getting sublist element till N
- Python Getting started with psycopg2-PostgreSQL
- Python - Getting started with SymPy module
- Program to find the formatted amount of cents of given amount in Python
- Python Pandas - Return an Index of formatted strings specified by date format
- Time Functions in Python?
Advertisements