Comments (5)
Where did you get from that 'US/Aleutian' is at UTC-9?
NIST only recognises a 'Hawaii-Aleutian Time', which is HST at UTC-10 – although the Aleutian Islands have a daylight saving time HDT at UTC-9, but that is not a geographical timezone. UTC-9 is Alaskan (AKST).
https://www.nist.gov/pml/time-and-frequency-division/local-time-faqs#zones
The current designation is somewhat misleading (for all 8 Mauna Kea and Haleakala sites), but it does not look like there is an incorrect TZ offset inferred from it anywhere.
from astropy-data.
As follows -
import datetime, pytz
print(datetime.datetime.now(pytz.timezone("US/Aleutian")).utcoffset().total_seconds()/60/60)
Prints -9.0
from astropy-data.
I think the problem might be highlighted in the NIST URL you shared here -
from astropy-data.
Yes; and the pytz
designation being at least arguably confusing – this is obviously switching automatically to DST for 'US/Aleutian' when applicable:
>>> utc_now = datetime.datetime(2021, 9, 18, 19, 0, 0, tzinfo=pytz.timezone('UTC'))
>>> utc_now.astimezone(pytz.timezone('US/Aleutian'))
datetime.datetime(2021, 9, 18, 10, 0, tzinfo=<DstTzInfo 'US/Aleutian' HDT-1 day, 15:00:00 DST>)
>>> utc_now.astimezone(pytz.timezone('US/Hawaii'))
datetime.datetime(2021, 9, 18, 9, 0, tzinfo=<DstTzInfo 'US/Hawaii' HST-1 day, 14:00:00 STD>)
>>> utc_now.astimezone(pytz.timezone('HST'))
datetime.datetime(2021, 9, 18, 9, 0, tzinfo=<StaticTzInfo 'HST'>)
>>> utc_thx = datetime.datetime(2021, 11, 25, 12, 0, 0, tzinfo=pytz.timezone('UTC'))
>>> utc_thx.astimezone(pytz.timezone('US/Aleutian'))
datetime.datetime(2021, 11, 25, 2, 0, tzinfo=<DstTzInfo 'US/Aleutian' HST-1 day, 14:00:00 STD>)
>>> utc_thx.astimezone(pytz.timezone('US/Hawaii'))
datetime.datetime(2021, 11, 25, 2, 0, tzinfo=<DstTzInfo 'US/Hawaii' HST-1 day, 14:00:00 STD>)
>>> utc_thx.astimezone(pytz.timezone('HST'))
datetime.datetime(2021, 11, 25, 2, 0, tzinfo=<StaticTzInfo 'HST'>)
Clearly it would be preferable to use the official TZ abbreviations throughout.
EDIT: from the tz database and e.g. https://home.kpn.nl/vanadovv/time/Multizones.html
'Aleutian' and 'Hawaii' are at least semi-officially denoting the parts observing/not observing DST; so there is a point in using them as they provide both information on the DST rules and the BaseTz/StaticTz. The correct one then of course is 'US/Hawaii'.
from astropy-data.
I am volunteering to fix the entries in a PR, preferably after consensus about a consistent format has been reached.
I must say that pytz
's treatment of the different formats is somewhat bewildering, e.g.
>>> datetime.datetime.now(pytz.timezone('US/Eastern'))
datetime.datetime(2021, 10, 9, 14, 49, 39, 25761, tzinfo=<DstTzInfo 'US/Eastern' EDT-1 day, 20:00:00 DST>)
>>> datetime.datetime.now(pytz.timezone('EST'))
datetime.datetime(2021, 10, 9, 13, 50, 1, 567091, tzinfo=<StaticTzInfo 'EST'>)
>>> datetime.datetime.now(pytz.timezone('US/Mountain'))
datetime.datetime(2021, 10, 9, 11, 50, 13, 203518, tzinfo=<DstTzInfo 'US/Mountain' MDT-1 day, 18:00:00 DST>)
>>> datetime.datetime.now(pytz.timezone('MST'))
datetime.datetime(2021, 10, 9, 10, 50, 21, 434496, tzinfo=<StaticTzInfo 'MST'>)
whereas for the European timezones
>>> datetime.datetime.now(pytz.timezone('Europe/Paris'))
datetime.datetime(2021, 10, 9, 20, 50, 33, 594535, tzinfo=<DstTzInfo 'Europe/Paris' CEST+2:00:00 DST>)
>>> datetime.datetime.now(pytz.timezone('CET'))
datetime.datetime(2021, 10, 9, 20, 50, 46, 475846, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>)
and CST
, PST
are not accepted at all...
That means replacing CET
with Europe/Capital
would probably have no practical effect (unless we had an entry for Europe/Zurich
in the summer of 1980...), but still be more easily recognisable IMO.
from astropy-data.
Related Issues (20)
- Add requests intersphinx HOT 2
- git on Windows cannot checkout all dirs in testing/astropy HOT 3
- Add astropy intersphinx
- Clean duplicates off sites.json HOT 5
- Add AAS facilities keywords to site-data? HOT 3
- Add preferred reference and citation to `sites.json`? HOT 4
- Remove testing/astropy ? HOT 3
- Rubin isn't a telescope HOT 2
- Set up CI for this repo HOT 6
- Allow non-ascii characters in sites.json (when enough astropy user base supports it) HOT 2
- Remove non-reduced FITS cube? HOT 1
- Big data warning from GitHub HOT 3
- Remove old matplotlib comparison images? HOT 6
- Intersphinx mappings are outdated HOT 1
- Add pytest intersphinx HOT 4
- Running a check on sites.json gives an error HOT 3
- Use Intake HOT 2
- Astropy Data Mirror HOT 2
- Update astropy.coordinates.EarthLocation.of_site for Lowell Observatory sites HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astropy-data.