フォームの日時文字列をFeb 25 2010, 16:19:20 CETUNIXエポックに変換するにはどうすればよいですか?
現在、私の最善のアプローチはtime.strptime()これを使用することです:
def to_unixepoch(s):
    # ignore the time zone in strptime
    a = s.split()
    b = time.strptime(" ".join(a[:-1]) + " UTC", "%b %d %Y, %H:%M:%S %Z")
    # this puts the time_tuple(UTC+TZ) to unixepoch(UTC+TZ+LOCALTIME)
    c = int(time.mktime(b))
    # UTC+TZ
    c -= time.timezone
    # UTC
    c -= {"CET": 3600, "CEST": 2 * 3600}[a[-1]]
    return c
calendar.timegm()他の質問から、これを単純化するために、などを使用できる可能性があることがわかりますpytzが、これらは省略されたタイムゾーンを処理しません。
余分なライブラリを最小限に抑えたソリューションが欲しいのですが、可能な限り標準ライブラリを維持したいと思います。