gwexpy.time.tconvert

gwexpy.time.tconvert(t='now', *args, **kwargs)[source]

Convert a time between GPS seconds and UTC datetime.

This function automatically detects the type of the input t. If t is numeric (or an array of numbers), it is assumed to be a GPS time and is converted to a datetime (like from_gps). If t is a string, datetime, or an array of those types, it is converted to GPS seconds (like to_gps).

Parameters:
  • t (numeric, str, datetime.datetime, array-like, optional) – The input time(s) to convert. Defaults to “now”.

  • *args – Additional positional arguments passed to the underlying converter.

  • **kwargs – Additional keyword arguments passed to the underlying converter.

Returns:

The converted time. The return type depends on the input type.

Return type:

float, datetime.datetime, or numpy.ndarray