Helpful Information
 
 
Category: Python
Need help to convert 24 hr time to 12 hr time

I need to write a program that converts 24 hour time to 12 hour time.
And I need three functions (an input function, conversion function, and output function).
Can someone show me some example code so I can get this to work.
Thank you so much for any and ALL help :thumbsup:

That should do it :




>>> from time import gmtime, strftime
>>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
'Thu, 28 Jun 2001 14:17:15 +0000'




check here for strftime codes:

http://docs.python.org/library/time.html#time.strftime










privacy (GDPR)