https://github.com/geospace-code/sciencedates
Date conversions used in the sciences.
https://github.com/geospace-code/sciencedates
date-conversion fortran geoscience julia matlab python
Last synced: about 1 month ago
JSON representation
Date conversions used in the sciences.
- Host: GitHub
- URL: https://github.com/geospace-code/sciencedates
- Owner: geospace-code
- License: mit
- Created: 2017-02-08T16:42:17.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T04:56:01.000Z (over 3 years ago)
- Last Synced: 2025-04-12T18:07:03.849Z (2 months ago)
- Topics: date-conversion, fortran, geoscience, julia, matlab, python
- Language: Python
- Size: 85 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Science Dates & Times
[](https://zenodo.org/badge/latestdoi/81351748)
[](https://lgtm.com/projects/g/scivision/sciencedates/context:python)
[](https://github.com/scivision/sciencedates/actions)
[](http://pepy.tech/project/sciencedates)Date & time conversions used in the sciences.
The assumption is that datetimes are **timezone-naive**, as this is required in Numpy *et al* for `numpy.datetime64`.## Install
```sh
python -m pip install sciencedates
```## Usage
### Datetime => Year, DayOfYear
```python
import sciencedates as sdT = '2013-07-02T12'
yeardoy, utsec = sd.datetime2yd(T)
```Results in year,DayOfYear; UTC fraction of day [seconds]
> (2013102, 72000.0)
## Julia
Julia [examples](./julia) are provided
## Matlab / GNU Octave
Matlab / GNU Octave [examples](./matlab) are provided
## Fortran
Fortran [examples](./fortran) are provided.
For Python-like modern Fortran datetime, see
[Datetime-Fortran](https://github.com/wavebitscientific/datetime-fortran).