How to get date and time in Python

Hi …to all today i learnt how to get the date and time in python..

here the codes are…

 

>>> from time import gmtime, strftime
>>> strftime(“%Y-%m-%d %H:%M:%S”, gmtime())
‘2009-01-05 22:14:39

for more Direct time modulation http://docs.python.org/library/time.html#time.strftime

Thats it..Thanks …

 

Author: Balaji

Hi..My name is Balaji and i am working as a Senior Software Developer in India. I am interested in Shell scripts, python, erlang , linux kernel .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: