From d0bf300975da73be49d3606b25101d6ce05e4767 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 18 Nov 2024 13:38:39 +0800 Subject: [PATCH] add monthfirstday function --- appPublic/timeUtils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appPublic/timeUtils.py b/appPublic/timeUtils.py index 8c58e7a..2a87d43 100755 --- a/appPublic/timeUtils.py +++ b/appPublic/timeUtils.py @@ -17,6 +17,10 @@ def days_between(date_str1, date_str2): days = abs(delta.days) return days +def monthfirstday(): + d = datetime.now() + return '%4d-%02d-01' % (d.year, d.month) + def curDatetime(): return datetime.now()