On 2005-04-17, Andrew E <[EMAIL PROTECTED]> wrote:
> Uwe Mayer wrote:
>> Hi,
>>
>> I've got a ISO 8601 formatted date-time string which I need to read into a
>> datetime object.
>> Is there a shorter way than using regular expressions? Is there a sscanf
>> function as in C?
>
> in addition to the
Uwe Mayer wrote:
> Hi,
>
> I've got a ISO 8601 formatted date-time string which I need to read into a
> datetime object.
> Is there a shorter way than using regular expressions? Is there a sscanf
> function as in C?
in addition to the other comments...
I like re, because it gives me the most con
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
--
http://mail.python.org/mailman/listin
Uwe Mayer skrev:
> Hi,
>
> I've got a ISO 8601 formatted date-time string which I need to read
> into a datetime object.
Look up time.strptime, it does exactly what you want.
--
Leif Biberg Kristensen
http://solumslekt.org/
--
http://mail.python.org/mailman/listinfo/python-list
Uwe Mayer wrote:
I've got a ISO 8601 formatted date-time string which I need to read into a
datetime object.
import time
help(time.strptime)
Help on built-in function strptime in module time:
strptime(...)
strptime(string, format) -> struct_time
Parse a string to a time tuple according to a
Hi,
I've got a ISO 8601 formatted date-time string which I need to read into a
datetime object.
Is there a shorter way than using regular expressions? Is there a sscanf
function as in C?
Thanks,
Uwe
--
http://mail.python.org/mailman/listinfo/python-list