gwexpy.time.tconvert#
- gwexpy.time.tconvert(gpsordate: SupportsToGps = 'now', *args, t=<omitted>, **kwargs)#
Convert a time between GPS seconds and UTC datetime.
This function automatically detects the type of the input. If it 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 the input is a string, datetime, or an array of those types, it is converted to GPS seconds (like to_gps).
- Parameters:
gpsordate (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.
t (numeric, str, datetime.datetime, array-like, optional) – GWexpy compatibility alias for
gpsordate. Supplying both names is an error.**kwargs – Additional keyword arguments passed to the underlying converter.
- Returns:
The converted time. The return type depends on the input type.
- Return type: