From 71b6001a5ad889660e098b4a737a128a3dddb6c6 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Thu, 29 Dec 2022 11:32:20 +0800 Subject: [PATCH] test --- py/test_time.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 py/test_time.py diff --git a/py/test_time.py b/py/test_time.py new file mode 100644 index 0000000..0b2ab13 --- /dev/null +++ b/py/test_time.py @@ -0,0 +1,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')) \ No newline at end of file -- GitLab