[BangPypers] Best way to convert this string into datetime object
kracekumar ramaraju
kracethekingmaker at gmail.com
Thu Aug 30 16:44:59 CEST 2012
In [27]: from dateutil import parser
In [28]: p = parser.parse("Thu Aug 30 11:59:18 +0000 2012")
In [29]: p.tzname
Out[29]: <function tzname>
In [30]: p.tzname()
Out[30]: 'UTC'
On Thu, Aug 30, 2012 at 8:09 PM, Kushal Das <kushaldas at gmail.com> wrote:
> On Thu, Aug 30, 2012 at 8:03 PM, Ramchandra Apte <maniandram01 at gmail.com>
> wrote:
> > Sorry you should use datetime.strptime
> >
> It was failing that is why I asked here.
>
> Managed to do this using dateutil package in the most simple way.
>
> Kushal
> --
> http://fedoraproject.org
> http://kushaldas.in
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
--
*
Thanks & Regards
"Talk is cheap, show me the code" -- Linus Torvalds
kracekumar
www.kracekumar.com
*
More information about the BangPypers
mailing list