-----Original Message----- From: Dave Angel [mailto:d...@davea.name] Sent: 26/04/2012 4:31 PM To: viral shah Cc: python-list@python.org Subject: Re: Set Date and Time on Python
On 04/26/2012 03:09 AM, viral shah wrote: > Hi > > I'm very new to Python programming. > > Please help me to add date and time ! > > Following is the code done by me. > > import datetime > class Module > type(datetime.datetime) > > Now what's the next to do for displaying date and time ? > Try this: import datetime now = datetime.datetime.now() now.strftime("%Y-%m-%d-%H:%M")----this will give you date time in this format " 2012-04-27-12:08" Hope this will work for you!!! Cheerz Shambhu -- http://mail.python.org/mailman/listinfo/python-list