times.py 文件源码

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

项目:nstock 作者: ybenitezf 项目源码 文件源码
def long_to_datetime(x):
    """Converts a long integer representing the number of microseconds since
    ``datetime.min`` to a datetime object.
    """

    days = x // 86400000000  # Microseconds in a day
    x -= days * 86400000000

    seconds = x // 1000000  # Microseconds in a second
    x -= seconds * 1000000

    return datetime.min + timedelta(days=days, seconds=seconds, microseconds=x)


# Ambiguous datetime object
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号