MCPcopy Create free account
hub / github.com/NCAR/wrf-python / _make_time

Function _make_time

src/wrf/util.py:2318–2334  ·  view source on GitHub ↗

Return a :class:`datetime.datetime` object for the array of characters. Args: timearr (:class:`numpy.ndarray`): An array of characters. Returns: :class:`datetime.datetime`: A datetime object.

(timearr)

Source from the content-addressed store, hash-verified

2316
2317
2318def _make_time(timearr):
2319 """Return a :class:`datetime.datetime` object for the array of characters.
2320
2321 Args:
2322
2323 timearr (:class:`numpy.ndarray`): An array of characters.
2324
2325 Returns:
2326
2327 :class:`datetime.datetime`: A datetime object.
2328
2329 """
2330 try:
2331 return dt.datetime.strptime("".join(npbytes_to_str(timearr)),
2332 "%Y-%m-%d_%H:%M:%S")
2333 except ValueError:
2334 return np.datetime64("NaT")
2335
2336
2337def _file_times(wrfin, do_xtime):

Callers 1

_file_timesFunction · 0.85

Calls 1

npbytes_to_strFunction · 0.85

Tested by

no test coverage detected