ver_32.py 文件源码

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

项目:dbf 作者: wenzhihong2003 项目源码 文件源码
def update_vfp_datetime(moment, *ignore):
    """
    Sets the date/time stored in moment
    moment must have fields:
        year, month, day, hour, minute, second, microsecond
    """
    data = [0] * 8
    if moment:
        hour = moment.hour
        minute = moment.minute
        second = moment.second
        millisecond = moment.microsecond // 1000       # convert from millionths to thousandths
        time = ((hour * 3600) + (minute * 60) + second) * 1000 + millisecond
        data[4:] = update_integer(time)
        data[:4] = update_integer(moment.toordinal() + VFPTIME)
    return bytes(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号