>>> dt = '06/01/2011 06'
>>> from datetime import datetime
>>> datetime.strptime(dt,'%d/%m/%y %T')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/_strptime.py", line 317, in _strptime
(bad_directive, format))
ValueError: 'T' is a bad directive in format '%d/%m/%y %T'
Hello Vadim,
Thanks, Yes en_GB locale has time format as %T so now it will take it as %T.
Try this on your localhost on python prompt
import locale setlocale( locale. LC_ALL, 'en_GB. utf8')
>>> locale.
'en_GB.utf8'
>>> locale. nl_langinfo( locale. T_FMT)
'%T'
>>> locale. nl_langinfo( locale. D_FMT)
'%d/%m/%y'
but what python2.6 is raising valueError:
>>> dt = '06/01/2011 06' strptime( dt,'%d/ %m/%y %T') python2. 6/_strptime. py", line 317, in _strptime
>>> from datetime import datetime
>>> datetime.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
(bad_directive, format))
ValueError: 'T' is a bad directive in format '%d/%m/%y %T'
Thanks,