string_to_datetime
Classes:
Name | Description |
---|---|
StringToDatetime |
Converts date strings into datetime64 data. |
Classes#
StringToDatetime #
Bases: DataConverter
Converts date strings into datetime64 data.
Allows parameters to specify the string format of the input data, as well as the timezone the input data are reported in. If the input timezone is not UTC, the data are converted to UTC time.
Methods:
Name | Description |
---|---|
convert |
|
warn_if_no_format_set |
|
Attributes:
Name | Type | Description |
---|---|---|
format |
Optional[str]
|
The date format the string is using (e.g., '%Y-%m-%d %H:%M:%S' for date strings |
timezone |
Optional[str]
|
The timezone of the data to convert. If provided, this converter will apply the |
to_datetime_kwargs |
Dict[str, Any]
|
A set of keyword arguments passed to the pandas.to_datetime() function as |
Attributes#
format
class-attribute
instance-attribute
#
The date format the string is using (e.g., '%Y-%m-%d %H:%M:%S' for date strings such as '2022-04-13 23:59:00'), or None (the default) to have pandas guess the format automatically. See strftime.org for more information on what formats can be used.
timezone
class-attribute
instance-attribute
#
The timezone of the data to convert. If provided, this converter will apply the appropriate offset to convert data from the specified timezone to UTC. The timezone of the output data is assumed to always be UTC.
to_datetime_kwargs
class-attribute
instance-attribute
#
A set of keyword arguments passed to the pandas.to_datetime() function as keyword arguments. Note that 'format' is already included as a keyword argument. Defaults to {}.
Functions#
convert #
convert(
data: xr.DataArray,
variable_name: str,
dataset_config: DatasetConfig,
retrieved_dataset: RetrievedDataset,
**kwargs: Any
) -> Optional[xr.DataArray]