>I want to make
>sure you guys, especially Alan & Dave, are appreciated for taking their
>own personal time to do this, for free.
Your bill will arrive shortly ;)
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 -
On Wed, Oct 26, 2011 at 4:46 AM, 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...
>
>
>
>
> ___
> Tutor maillist - Tutor@python.
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
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...
>>> time.strftime("%H:%M", time.strptime("12:34am", "%I:%M%p"))
'00:34'
>>> datetime.datetime.strptime("12:34am", "%I:%M%p
Hi Praveen,
Do you want to create the functon time24hr which with a string as an
argument of the type ("12:24am") or ("12:24pm") returns an output of
("0024hr") or ("1224hr"), right?
Is this format fixed? I mean, can you create a two arguments function? (i.e
time24hr("12:24", "AM") )
If you cann
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...
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailm