[2.4.4] creating a datetime.datetime from an XML xs:dateTime

Discussion in 'Python' started by Martin, Dec 27, 2008.

  1. Martin

    Martin Guest

    Hi,

    subject says it all. I'd like to create a python datetime.datetime
    from an xs:string[1]

    I know about time.strptime and could get to a datetime.datetime from
    there, but that would be error prone like:

    * are there time zones?
    * how is the year represented
    * etc, yadda yadda

    so I'd rather like to find some method (hopefully within the standard
    lib) that had more peer review than only me :).

    thanks
    martin

    [1] http://www.w3.org/TR/xmlschema-2/#dateTime
    --
    http://soup.alt.delete.co.at
    http://www.xing.com/profile/Martin_Marcher
    http://www.linkedin.com/in/martinmarcher

    You are not free to read this message,
    by doing so, you have violated my licence
    and are required to urinate publicly. Thank you.

    Please avoid sending me Word or PowerPoint attachments.
    See http://www.gnu.org/philosophy/no-word-attachments.html
    Martin, Dec 27, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    691
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    524
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    378
    John Machin
    Jul 28, 2006
  4. Replies:
    2
    Views:
    745
    M.-A. Lemburg
    Jan 6, 2009
  5. NiklasRTZ

    datetime.datetime. or datetime. ?

    NiklasRTZ, Oct 8, 2009, in forum: Python
    Replies:
    10
    Views:
    537
    niklasr
    Oct 11, 2009
Loading...

Share This Page