.. _timeseries-times: Converting between Different Time Representations ************************************************* In :ref:`timeseries-accessing-times`, we saw how to access the time columns/attributes of the |TimeSeries| and |BinnedTimeSeries| classes. Here we look in more detail at how to manipulate the resulting times. Converting Times ================ Since the time column in time series is always a |Time| object, it is possible to use the usual attributes on |Time| to convert the time to different formats or scales. Example ------- .. EXAMPLE START: Converting the Time Column to Different Time Formats To get the times as modified Julian Dates from a minimal time series:: >>> from astropy import units as u >>> from astropy.timeseries import TimeSeries >>> ts = TimeSeries(time_start='2016-03-22T12:30:31', time_delta=3 * u.s, ... data={'flux': [1., 3., 4., 2., 4.]}) >>> ts.time.mjd # doctest: +FLOAT_CMP array([57469.52119213, 57469.52122685, 57469.52126157, 57469.5212963 , 57469.52133102]) Or to convert the times to the Temps Atomique International (TAI) scale:: >>> ts.time.tai