sscanf needed

Kent Johnson kent37 at tds.net
Sun Apr 17 11:44:23 EDT 2005


Uwe Mayer wrote:
> Hi,
> 
> I've got a ISO 8601 formatted date-time string which I need to read into a
> datetime object.

Something like this (adjust the format to suit):
import datetime, time
dt = datetime.datetime(*time.strptime(data, "%Y-%m-%d %H:%M:%S")[:6])

Kent



More information about the Python-list mailing list