This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author techtonik
Recipients ajaksu2, daniel.urban, eric.araujo, l0nwlf, techtonik
Date 2010-04-28.08:44:37
SpamBayes Score 0.00039503849
Marked as misclassified No
Message-id <1272444279.86.0.32098060193.issue7584@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks Daniel. I am still interested in this. My Python code as well as your patch doesn't specify that "Z" must be present when time zone offset is unknown or absent, but Atom specification mentions that and I believe this is that most users expect to see. In fact I needed such function for implementing Atom feed for Trac, so in my opinion Z is more clear than -00:00 or +00:00

I also was waiting for a final resolution of issue7582 which discusses the proper way to get UTC offset. The function used to correctly build RFC 3339 timestamp from file modification time evolved to the following code:

def isomtime(fname):
    """Return file modification time in RFC 3339 (ISO 8601 compliant) format"""
    stamp = time.localtime(os.stat(fname).st_mtime)

    # determine UTC offset rounded to minutes
    # (see http://bugs.python.org/issue7582 for discussion)
    #   true if file was modified during active DST
    isdst = stamp.tm_isdst
    utcoffset = -(time.altzone if (time.daylight and isdst) else time.timezone) // 60

    suffix = "%+03d:%02d" % (utcoffset // 60, abs(utcoffset) % 60)
    return time.strftime("%Y-%m-%dT%H:%M:%S", stamp) + suffix
History
Date User Action Args
2010-04-28 08:44:39techtoniksetrecipients: + techtonik, ajaksu2, eric.araujo, daniel.urban, l0nwlf
2010-04-28 08:44:39techtoniksetmessageid: <1272444279.86.0.32098060193.issue7584@psf.upfronthosting.co.za>
2010-04-28 08:44:38techtoniklinkissue7584 messages
2010-04-28 08:44:37techtonikcreate