time_conversion#
Methods for converting between Python datetimes, timestamps and ISO 8061 strings.
- hsr4hci.time_conversion.date_string_to_datetime(date_string, tzinfo=timezone.utc)[source]#
Convert a datetime from string (usually ISO 8061 for FITS files) to a Python datetime object.
- hsr4hci.time_conversion.date_string_to_timestamp(date_string, tzinfo=timezone.utc)[source]#
Convert a
date_string(usually ISO 8061 for FITS files) to a UNIX timestamp (i.e., seconds since January 1, 1970).
- hsr4hci.time_conversion.round_minutes(dt, direction, resolution=5)[source]#
Auxiliary function to round the minutes of a given datetime
dtto the desiredresolution(e.g., closest 5 minutes). Seconds and milliseconds are discarded.
- hsr4hci.time_conversion.timestamp_to_date_string(timestamp, tzinfo=timezone.utc, include_timezone=False)[source]#
Convert a given UNIX timestamp to a ISO 8061-formatted string.
- Parameters:
- Returns:
An ISO 8061-formatted string that matches the given timestamp.
- Return type: