obspy.io.sh.core.to_utcdatetime

to_utcdatetime(value)[source]

Converts time string used within Seismic Handler into a UTCDateTime.

Parameters:

value (str) – A Date time string.

Returns:

Converted UTCDateTime object.

Example

>>> to_utcdatetime(' 2-JAN-2008_03:04:05.123')
UTCDateTime(2008, 1, 2, 3, 4, 5, 123000)
>>> to_utcdatetime('2-JAN-2008')
UTCDateTime(2008, 1, 2, 0, 0)
>>> to_utcdatetime('2-JAN-08')
UTCDateTime(2008, 1, 2, 0, 0)
>>> to_utcdatetime('2-JAN-99')
UTCDateTime(1999, 1, 2, 0, 0)
>>> to_utcdatetime('2-JAN-2008_1')
UTCDateTime(2008, 1, 2, 1, 0)
>>> to_utcdatetime('2-JAN-2008_1:1')
UTCDateTime(2008, 1, 2, 1, 1)