MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / convert_time_to_nexus_string

Function convert_time_to_nexus_string

pyxrf/core/utils.py:310–328  ·  view source on GitHub ↗

Convert time to a string according to NEXUS format Parameters ---------- t : time.struct_time Time in the format returned by ``time.localtime`` or ``time.gmtime`` Returns ------- t : str A string represetation of time according to NEXUS standard

(t)

Source from the content-addressed store, hash-verified

308
309
310def convert_time_to_nexus_string(t):
311 """
312 Convert time to a string according to NEXUS format
313
314 Parameters
315 ----------
316
317 t : time.struct_time
318 Time in the format returned by ``time.localtime`` or ``time.gmtime``
319
320 Returns
321 -------
322
323 t : str
324 A string represetation of time according to NEXUS standard
325 """
326 # Convert to sting format recommented for NEXUS files
327 t = ttime.strftime("%Y-%m-%dT%H:%M:%S+00:00", t)
328 return t
329
330
331def convert_time_from_nexus_string(t):

Callers 3

_save_xanes_maps_to_tiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected