mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
[1.5.x] Fixed #21256 -- Error in datetime_safe.datetime.combine.
Backport of d9b6fb8
from master
This commit is contained in:
parent
2fb127b881
commit
ef9133768c
1 changed files with 5 additions and 2 deletions
|
@ -19,8 +19,11 @@ class datetime(real_datetime):
|
|||
def strftime(self, fmt):
|
||||
return strftime(self, fmt)
|
||||
|
||||
def combine(self, date, time):
|
||||
return datetime(date.year, date.month, date.day, time.hour, time.minute, time.microsecond, time.tzinfo)
|
||||
@classmethod
|
||||
def combine(cls, date, time):
|
||||
return cls(date.year, date.month, date.day,
|
||||
time.hour, time.minute, time.second,
|
||||
time.microsecond, time.tzinfo)
|
||||
|
||||
def date(self):
|
||||
return date(self.year, self.month, self.day)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue