5.4 KiB
5.4 KiB
In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 12, 8In [ ]:
from obspy import UTCDateTime
print(UTCDateTime("2011-03-11T05:46:23.2")) # mostly time strings defined by ISO standard
print(UTCDateTime("2011-03-11T14:46:23.2+09:00")) # non-UTC timezone input
print(UTCDateTime(2011, 3, 11, 5, 46, 23, 2))
print(UTCDateTime(1299822383.2))In [ ]:
# Current time can be initialized by leaving out any arguments
print(UTCDateTime())In [ ]:
time = UTCDateTime("2011-03-11T05:46:23.200000Z")
print(time.year)
print(time.julday)
print(time.timestamp)
print(time.weekday)
# try time.<Tab>In [ ]:
time = UTCDateTime("2011-03-11T05:46:23.200000Z")
print(time)In [ ]:
# one hour later
print(time + 3600)In [ ]:
time2 = UTCDateTime(2012, 1, 1)
print(time2 - time)In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
times = ["2001-06-23T20:33:09",
"2003-09-25T19:50:07",
"2004-12-23T14:59:00",
"2004-12-26T00:58:52",
"2005-03-28T16:09:35",
"2006-06-01T18:57:02",
"2006-06-05T00:50:31",
"2006-11-15T11:14:14",
"2007-01-13T04:23:23",
"2007-04-01T20:39:56",
"2007-08-15T23:40:58",
"2007-09-12T11:10:26",
"2009-09-29T17:48:11",
"2010-02-27T06:34:13",
"2011-03-11T05:46:23",
"2012-04-11T08:38:36",
"2012-04-11T10:43:10",
"2013-05-24T05:44:48"]In [ ]:
In [ ]:
