.. _astropy_time: .. include:: references.txt **************************************************** Time and Dates (`astropy.time`) **************************************************** Introduction ============ The `astropy.time` package provides functionality for manipulating times and dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in astronomy. It uses Cython to wrap the C language `SOFA`_ time and calendar routines. All time scale conversions are done by Cython vectorized versions of the `SOFA`_ routines and are fast and memory efficient. Getting Started =============== The basic way to use `astropy.time` is to create a |Time| object by supplying one or more input time values as well as the `time format`_ and `time scale`_ of those values. The input time(s) can either be a single scalar like `"2010-01-01 00:00:00"` or a list or a `numpy` array of values as shown below. In general any output values have the same shape (scalar or array) as the input. >>> from astropy.time import Time >>> times = ['1999-01-01 00:00:00.123456789', '2010-01-01 00:00:00'] >>> t = Time(times, format='iso', scale='utc') >>> t