test_time.py 620 字节
Newer Older
H
test  
hjdhnx 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File  : test_time.py
# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------
# Date  : 2022/12/29

import datetime
from datetime import timedelta

if __name__ == '__main__':
    # a = datetime.datetime.now().now().replace(hour=0, minute=1)).strftime('%Y-%m-%d %H:%M:%S')
    # print(a)
    print(datetime)
    print(datetime.datetime.now())
    print(datetime.datetime.now().replace(hour=0, minute=1).strftime('%Y-%m-%d %H:%M:%S'))
    print((datetime.datetime.now().replace(hour=0, minute=0, second=0)+ timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S'))