diff --git a/Changelog b/Changelog index d8bf9006..ac2efe27 100644 --- a/Changelog +++ b/Changelog @@ -10,6 +10,8 @@ version 1.3.0 (release tag v1.3.0rel) digits can be handled. * Change default calendar in cftime.date2num from 'standard' to None (calendar associated with first input datetime object is used). + * add `cftime.datetime.tzinfo=None` for compatibility with python datetime + (issue #208). version 1.2.1 (release tag v1.2.1rel) ===================================== diff --git a/cftime/_cftime.pyx b/cftime/_cftime.pyx index b53d4b65..4e6b5b19 100644 --- a/cftime/_cftime.pyx +++ b/cftime/_cftime.pyx @@ -913,6 +913,7 @@ The default format of the string produced by strftime is controlled by self.form cdef readonly str calendar cdef readonly int _dayofwk, _dayofyr cdef readonly bint has_year_zero + cdef readonly object tzinfo # Python's datetime.datetime uses the proleptic Gregorian # calendar. This boolean is used to decide whether a @@ -933,6 +934,7 @@ The default format of the string produced by strftime is controlled by self.form self.microsecond = microsecond self._dayofwk = dayofwk self._dayofyr = dayofyr + self.tzinfo = None if calendar: calendar = calendar.lower() if calendar == 'gregorian' or calendar == 'standard':