mirror of
https://github.com/donnemartin/data-science-ipython-notebooks.git
synced 2024-03-22 13:30:56 +08:00
Added snippet for strptime
This commit is contained in:
parent
c4cda0bd0c
commit
91f5a0d84b
|
@ -38,3 +38,8 @@ class TestDateUtil():
|
|||
dt = datetime(self.year, self.month, self.day,
|
||||
self.hour, self.minute, self.second)
|
||||
assert_equal(dt.strftime('%m/%d/%Y %H:%M'), '01/20/2015 07:28')
|
||||
|
||||
def test_strptime(self):
|
||||
"""Convert/parse string into datetime objects"""
|
||||
dt = datetime(self.year, self.month, self.day)
|
||||
assert_equal(datetime.strptime('20150120', '%Y%m%d'), dt)
|
Loading…
Reference in New Issue
Block a user