MCPcopy
hub / github.com/pydata/xarray / format_cftime_datetime

Function format_cftime_datetime

xarray/coding/times.py:791–795  ·  view source on GitHub ↗

Converts a cftime.datetime object to a string with the format: YYYY-MM-DD HH:MM:SS.UUUUUU

(date)

Source from the content-addressed store, hash-verified

789
790
791def format_cftime_datetime(date) -> str:
792 """Converts a cftime.datetime object to a string with the format:
793 YYYY-MM-DD HH:MM:SS.UUUUUU
794 """
795 return f"{date.year:04d}-{date.month:02d}-{date.day:02d} {date.hour:02d}:{date.minute:02d}:{date.second:02d}.{date.microsecond:06d}"
796
797
798def infer_timedelta_units(deltas) -> str:

Callers 4

infer_datetime_unitsFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…