diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-10-13 19:09:26 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-10-13 19:11:53 +0200 |
| commit | ef9133768c2aed52646ad0b6274edf836aa672b2 (patch) | |
| tree | 33777d832d56c959e32a92cebe59ba2ae699a97e /django/utils | |
| parent | 2fb127b8813ad049938e398e757d9ecef0eaacde (diff) | |
[1.5.x] Fixed #21256 -- Error in datetime_safe.datetime.combine.
Backport of d9b6fb8 from master
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/datetime_safe.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/utils/datetime_safe.py b/django/utils/datetime_safe.py index b634888092..ca96fb37b0 100644 --- a/django/utils/datetime_safe.py +++ b/django/utils/datetime_safe.py @@ -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) |
