[Numpy-discussion] Making datetime64 timezone naive

Alexander Belopolsky ndarray at mac.com
Mon Oct 19 16:11:54 EDT 2015


On Mon, Oct 19, 2015 at 3:34 PM, Chris Barker <chris.barker at noaa.gov> wrote:

>
> > In Python 3.6, datetime.now() will return different values in the first
> and the second repeated hour in the "fall-back fold." > If you allow
> datetime.datetime to numpy.datetime64 conversion, you should decide what
> you do with that difference.
>
> Indeed. Though will that only occur with timezones that have DST? I know
> I'd be fine with NOT being able to create a numpy datetime64 from a
> non-naive datetime object.
>

datetime.now() returns *naive*  datetime objects unless you supply the
timezone.  In Python 3.6 *naive* datetime objects will have the fold
attribute and datetime.now()  will occasionally return fold=1 values unless
your system timezone has a fixed UTC offset.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151019/d740f20a/attachment.html>


More information about the NumPy-Discussion mailing list