This is quirky. >>> t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S") >>> t1 datetime.datetime(2009, 12, 5, 22, 11) >>> type(t1) <type 'datetime.datetime'> >>> t1: 2009-12-05 22:11:00 <type 'datetime.datetime'>
but in the program: import datetime t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S") print "t1: ",t1, type(t1) produces t1: 2009-12-05 22:11:00 <type 'datetime.datetime'> Where did the hyphens and colons come from? -- http://mail.python.org/mailman/listinfo/python-list