Skip to content
Date conversions used in the sciences.
Python Julia Fortran MATLAB
Branch: master
Clone or download
Latest commit f776b74 Nov 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
archive ci template github actions Nov 11, 2019
fortran CI template, multilanguage Dec 3, 2018
julia CI template, multilanguage Dec 3, 2018
matlab remove restriction [skip ci] Dec 3, 2018
sciencedates ci template github actions Nov 11, 2019
tests
.codeclimate.yml
.coveragerc CI template May 20, 2019
.flake8 CI template May 20, 2019
.gitattributes
.gitignore Improve test robustness and clarity Jul 20, 2018
CODE_OF_CONDUCT.md
LICENSE.txt meta Jun 24, 2019
README.md
date2doy.py
findnearest.py in Jul 10, 2018
mypy.ini ci template github actions Nov 11, 2019
pyproject.toml ci template github actions Nov 11, 2019
pytest.ini
randomdate.py ci template github actions Nov 11, 2019
setup.cfg ci template github actions Nov 11, 2019
setup.py

README.md

image Actions Status

Python versions (PyPI) PyPi Download stats

Science Dates & Times

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

python -m pip install sciencedates

Usage

Datetime => Year, DayOfYear

import sciencedates as sd

T = '2013-07-02T12'
yeardoy, utsec = sd.datetime2yd(T)

Results in year,DayOfYear; UTC fraction of day [seconds]

(2013102, 72000.0)

Julia

Julia examples are provided

Matlab / GNU Octave

Matlab / GNU Octave examples are provided

Fortran

Fortran examples are provided. For Python-like modern Fortran datetime, see Datetime-Fortran.

You can’t perform that action at this time.