[XML-SIG] Re: RSS and stuff

Walter Underwood wunder@infoseek.com
Wed, 02 Jun 1999 17:04:20 -0700


At 04:14 PM 6/2/99 -0700, Dan Libby wrote:
>
>3) The time support is IS0 8601 only, which is itself a very complicated subject.
>(aside: anyone know of a python module to parse dates according to 8601?).  I
>would like to see support for unix/c style integer timestamps (seconds since 1970
>UNC, as returned by time() ). 

It's not that bad. Insist on the web profile of ISO 8601 and 
there are only five formats. Do an sscanf or re.match for
each format, and when one converts, do time.mktime() with what
you've just parsed.

And let's try to avoid using seconds-since-the-epoch in external
formats. We're just now doing the Y2K thing, so I don't think it
is a good idea to use formats that fall apart in 2037.

Here is what it takes to convert a Unix timestamp to ISO 8601:

def make_date(timeint):
    return time.strftime('%Y-%m-%dT%H:%M:%SZ',time.gmtime(timeint))

wunder

--
Walter R. Underwood
wunder@infoseek.com
wunder@best.com (home)
http://software.infoseek.com/cce/ (my product)
http://www.best.com/~wunder/
1-408-543-6946