is_time#

sunpy.time.is_time(time_string, time_format=None)[source]#

Returns true if the input is a valid date/time representation.

Parameters:
  • time_string (int, float, time_string, datetime) – Date to parse.

  • time_format (basestring, utime, datetime, optional) – Specifies the format user has provided the time_string in.

Returns:

boolTrue if can be parsed by sunpy.time.parse_time.

Examples

>>> import sunpy.time
>>> sunpy.time.is_time('2012/08/01')
True