SunPy uses python
datetime module for handling almost all time related things.
datetime is not the best choice for astronomy related projects due to a lot of reasons (for instance, it does not handle leap seconds). The answer is to use
time module from
astropy.time.Time can do a lot things including:
- Handle leap seconds
- Easy conversion between format like
- Easy conversion between scales like
- Can be initialized from and converted to a lot of popular time formats and even supports python
- Ability to create custom classes to support extra formats of time.
astropy.time the best candidate to replace python
datetime in SunPy.
This project will transition the whole of SunPy to use
astropy.time instead of python