add .date()

This commit is contained in:
blueloveTH 2024-01-25 17:49:20 +08:00
parent 0a63fcb7b0
commit ce1bc278e3

View File

@ -91,6 +91,9 @@ class datetime(date):
raise ValueError("Second must be between 0 and 59") raise ValueError("Second must be between 0 and 59")
self.second = second self.second = second
def date(self) -> date:
return date(self.year, self.month, self.day)
@staticmethod @staticmethod
def now(): def now():
t = localtime() t = localtime()