tools.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:hachoir3 作者: vstinner 项目源码 文件源码
def timestampWin64(value):
    """
    Convert Windows 64-bit timestamp to string. The timestamp format is
    a 64-bit number which represents number of 100ns since the
    1st January 1601 at 00:00. Result is an unicode string.
    See also durationWin64(). Maximum date is 28 may 60056.

    >>> timestampWin64(0)
    datetime.datetime(1601, 1, 1, 0, 0)
    >>> timestampWin64(127840491566710000)
    datetime.datetime(2006, 2, 10, 12, 45, 56, 671000)
    """
    try:
        return WIN64_TIMESTAMP_T0 + durationWin64(value)
    except OverflowError:
        raise ValueError("date newer than year %s (value=%s)"
                         % (MAXYEAR, value))


# Start of 60-bit UUID timestamp: 15 October 1582 at 00:00
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号