def timestamp_Ms_transform(value):
    """Transform timestamp in microseconds to ISO 8601 date format.

    :param int value: Unix timestamp in microseconds
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ""

    return timestamp_transform(dateutils.normalize_timestamp(value, "timestamp_unix_Ms"))
Esempio n. 2
0
def timestamp_Ms_transform(value):
    """Transform timestamp in microseconds to ISO 8601 date format.

    :param int value: Unix timestamp in microseconds
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ''

    return timestamp_transform(
        dateutils.normalize_timestamp(value, 'timestamp_unix_Ms'))
def timestamp_apple_transform(value):
    """Transform apple timestamp to ISO 8601 date format.

    Apple timestamps (e.g. those used on iOS) start at 2001-01-01.

    :param int value: apple timestamp
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ""

    return timestamp_transform(dateutils.normalize_timestamp(value, "timestamp_apple"))
def timestamp_webkit_transform(value):
    """Transform WebKit timestamp to ISO 8601 date format.

    WebKit timestamps are expressed in microseconds and
    start at 1601-01-01.

    :param int value: WebKit timestamp
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ""

    return timestamp_transform(dateutils.normalize_timestamp(value, "timestamp_webkit"))
Esempio n. 5
0
def timestamp_apple_transform(value):
    """Transform apple timestamp to ISO 8601 date format.

    Apple timestamps (e.g. those used on iOS) start at 2001-01-01.

    :param int value: apple timestamp
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ''

    return timestamp_transform(
        dateutils.normalize_timestamp(value, 'timestamp_apple'))
Esempio n. 6
0
def timestamp_webkit_transform(value):
    """Transform WebKit timestamp to ISO 8601 date format.

    WebKit timestamps are expressed in microseconds and
    start at 1601-01-01.

    :param int value: WebKit timestamp
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ''

    return timestamp_transform(
        dateutils.normalize_timestamp(value, 'timestamp_webkit'))
def timestamp_julian_transform(value, date_only=False):
    """Transform Julian timestamp to ISO 8601 date format.

    Julian timestamps are the number of days that has passed since
    noon Universal Time on January 1, 4713 BCE.

    :param int value: Julian timestamp in days
    :param bool date_only: if we should format only the date part,
         ignoring the time
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ""

    return timestamp_transform(dateutils.normalize_timestamp(value, "timestamp_julian"), date_only=date_only)
Esempio n. 8
0
def timestamp_julian_transform(value, date_only=False):
    """Transform Julian timestamp to ISO 8601 date format.

    Julian timestamps are the number of days that has passed since
    noon Universal Time on January 1, 4713 BCE.

    :param int value: Julian timestamp in days
    :param bool date_only: if we should format only the date part,
         ignoring the time
    :return: the datetime represented in ISO 8601 format
    :rtype: str
    """
    if value is None:
        return ''

    return timestamp_transform(
        dateutils.normalize_timestamp(value, 'timestamp_julian'),
        date_only=date_only)