Display datetime64 arrays without showing local timezones
See original GitHub issueNumPy has an unfortunate way of adding local timezone offsets when printing datetime64 arrays:
<xray.DataArray 'time' (time: 4000)>
array(['1999-12-31T16:00:00.000000000-0800',
'2000-01-01T16:00:00.000000000-0800',
'2000-01-02T16:00:00.000000000-0800', ...,
'2010-12-10T16:00:00.000000000-0800',
'2010-12-11T16:00:00.000000000-0800',
'2010-12-12T16:00:00.000000000-0800'], dtype='datetime64[ns]')
Coordinates:
* time (time) datetime64[ns] 2000-01-01 2000-01-02 2000-01-03 ...
We should use custom formatting code to remove the local timezone (to encourage folks just to use naive timezones/UTC).
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
convertion of datetime to numpy datetime without timezone info
I think there are 2 issues - how the datetime.datetime object is converted to np.datetime64 , and how the later is displayed.
Read more >Decoding time and timezones with datetime64[ns]
My computer happens to be set to UTC-4. I'm not sure how to go about telling xray to ignore the local timezone when...
Read more >Datetimes and Timedeltas — NumPy v1.24 Manual
Starting in NumPy 1.7, there are core array data types which natively support datetime functionality. The data type is called datetime64 , so...
Read more >pandas.Series.dt.tz_convert — pandas 1.5.2 documentation
Convert tz-aware Datetime Array/Index from one time zone to another. Parameters ... A tz of None will convert to UTC and remove the...
Read more >Converting time zone in Microsoft Power Automate
Provides a solution to an issue where you find a datetime in the wrong time zone.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The good news is that I fixed this display bug upstream in NumPy 1.11, which came out last month. If you upgrade to NumPy 1.11, datetimes are always treated as timezone naive. So I think we can actually consider this issue fixed.
sounds good to me, @sjpfenninger, but I don’t know the internals …