parse_time#

sunpy.time.parse_time(time_string, *, format=None, **kwargs)[source]#

Takes a time input and will parse and return a astropy.time.Time.

Parameters:
Returns:

astropy.time.TimeTime corresponding to input time string.

Examples

>>> import sunpy.time
>>> sunpy.time.parse_time('2012/08/01')
<Time object: scale='utc' format='isot' value=2012-08-01T00:00:00.000>
>>> sunpy.time.parse_time('2016.05.04_21:08:12_TAI')
<Time object: scale='tai' format='isot' value=2016-05-04T21:08:12.000>

Notes

Additional keyword arguments can be passed to astropy.time.Time

The list of time formats are show by the following examples:

2017-01-01T11:10:09.000000
2017/01/01T11:10:09.000000
2017-01-01T11:10:09.000000Z
2017-01-01T11:10:09
2017/01/01T11:10:09
20170101T111009.000000
20170101T111009
2017/01/01 11:10:09
2017/01/01 11:10
2017/01/01 11:10:09.000000
2017-01-01 11:10:09.000000
2017-01-01 11:10:09
2017-01-01 11:10
2017-Jan-01 11:10:09.000000
2017-Jan-01 11:10:09
2017-Jan-01 11:10
2017-Jan-01
2017-01-01
2017/01/01
01-Jan-2017
01-Jan-2017 11:10:09
01-Jan-2017 11:10:09.000000
20170101_111009
2017:001:11:10:09
2017:001:11:10:09.000000
20170101111009
2017.01.01_11:10:09_TAI
2017.01.01_11:10:09_UTC
2017.01.01_11:10:09
2017/01/01T11:10