mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 23:00:18 +00:00
auto
This commit is contained in:
+6
-4
@@ -26,6 +26,11 @@ Just playing with an API here:
|
||||
>>> tomorrow.datetime()
|
||||
datetime.datetime(2016, 12, 16, 15, 11, 30, 263350, tzinfo=<UTC>)
|
||||
|
||||
# Automatically parse datetime strings and generate naive datetimes.
|
||||
>>> scraped = '2016-12-16 18:23:45.423992+00:00'
|
||||
>>> maya.parse(scraped).datetime(to_timezone='US/Eastern', naive=True)
|
||||
datetime.datetime(2016, 12, 16, 13, 23, 45, 423992)
|
||||
|
||||
>>> rand_day = maya.when('2011-02-07', timezone='US/Eastern')
|
||||
<MayaDT epoch=1297036800.0>
|
||||
|
||||
@@ -37,10 +42,7 @@ Just playing with an API here:
|
||||
>>> rand_day.timezone
|
||||
<UTC>
|
||||
|
||||
# Automatically parse datetime strings and generate naive datetimes.
|
||||
>>> scraped = '2016-12-16 18:23:45.423992+00:00'
|
||||
>>> maya.parse(scraped).datetime(to_timezone='US/Eastern', naive=True)
|
||||
datetime.datetime(2016, 12, 16, 13, 23, 45, 423992)
|
||||
|
||||
|
||||
Timezones fit more in here somewhere...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user