On 26/10/11 09:46, Praveen Singh wrote:
How can i convert this-
>>>time24hr('12:34am')
'0034hr'
i searched in date module but i am not able to figure out what how to do
this...
In the time module you can use strptime to convert a string to a tuple.
And you can use strftime to convert a tuple to a string with user
specified formatting. I suspect one option will be 24 hour format.
So a combination of the two should achieve what you want...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor