Example #1
0
def convert_exif_date(str):
    try:
        date = datetime.strptime(str, "%Y:%m:%d %H:%M:%S")
    except ValueError:
        return None
    return zulu(utc.fromutc(date))
Example #2
0
def parse_zulu(txt):
    return utc.fromutc(datetime.strptime(txt, "%Y-%m-%dT%H:%M:%S.%fZ"))
def parse_zulu(txt):
    """Parses an ISO format date into a DateTime."""

    return utc.fromutc(datetime.strptime(txt, "%Y-%m-%dT%H:%M:%S.%fZ"))
Example #4
0
def time_from_unix(t):
    return utc.fromutc(datetime.utcfromtimestamp(t))
def time_from_unix(t):
    """Convert UTC timestamp int to its corresponding DateTime."""
    return utc.fromutc(datetime.utcfromtimestamp(t))