@@ -35,9 +35,9 @@ def hapitime_reformat(form_to_match, given_form, logging=False):
3535 Examples
3636 --------
3737 ::
38-
39- hapitime_format_str ('1989Z', '1989-01Z') # 1989Z
40- hapitime_format_str ('1989-001T00:00Z', '1999-01-21Z') # 1999-021T00:00Z
38+ from hapiclient.hapitime import hapitime_reformat
39+ hapitime_reformat ('1989Z', '1989-01Z') # 1989Z
40+ hapitime_reformat ('1989-001T00:00Z', '1999-01-21Z') # 1999-021T00:00Z
4141
4242 """
4343
@@ -93,7 +93,15 @@ def hapitime_reformat(form_to_match, given_form, logging=False):
9393
9494
9595def hapitime_format_str (Time ):
96- """Determine the time format string for a HAPI time."""
96+ """Determine the time format string for a HAPI time.
97+ Examples
98+ --------
99+ ::
100+ from hapiclient.hapitime import hapitime_reformat
101+ hapitime_format_str(['1989Z']) # %YZ
102+ hapitime_format_str(['1989-347Z']) # %Y-%jZ
103+ hapitime_format_str(['2002-03-04T05:06Z']) # '%Y-%m-%dT%H:%MZ'
104+ """
97105
98106 d = 0
99107 # Catch case where no trailing Z
@@ -200,10 +208,10 @@ def hapitime2datetime(Time, **kwargs):
200208
201209 ::
202210
203- from hapiclient.time import hapitime2datetime
211+ from hapiclient.hapitime import hapitime2datetime
204212 import numpy as np
205213
206- hapitime2datetime(np.array([b'1970-01-01T00:00:00.000Z']))
214+ hapitime2datetime(np.array([b'1970-01-01T00:00:00.000Z'])) # array([datetime.datetime(1970, 1, 1, 0, 0, tzinfo=<UTC>)], dtype=object)
207215 hapitime2datetime(np.array(['1970-01-01T00:00:00.000Z']))
208216
209217 hapitime2datetime([b'1970-01-01T00:00:00.000Z'])
@@ -320,4 +328,4 @@ def hapitime2datetime(Time, **kwargs):
320328 if reshape :
321329 pythonDateTime = np .reshape (pythonDateTime , shape )
322330
323- return pythonDateTime
331+ return pythonDateTime
0 commit comments