Skip to content

Commit c236691

Browse files
committed
2 parents 5ecdefc + 0085725 commit c236691

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

slides_sources/source/datetime.rst

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Daylight savings time challenges
2626
Daylight savings time creates discontinuities in a time series
2727

2828
.. image:: /_static/dst_sf_graph.png
29-
:height: 400px
29+
:height: 250px
3030

3131
.. image:: /_static/dst_fb_graph.png
32-
:height: 400px
32+
:height: 250px
3333

3434
On representing a point in time
3535
-------------------------------
@@ -59,8 +59,11 @@ the letter Z, e.g. 12:59Z
5959
It is similar to, but not the same as, Greenwich Mean Time (GMT). UTC is
6060
more precisely defined
6161

62+
.. nextslide::
63+
6264
.. image:: /_static/Greenwich_clock.jpg
63-
65+
:height: 500px
66+
6467
`UNIX time <http://en.wikipedia.org/wiki/Unix_time>`__
6568
------------------------------------------------------
6669

@@ -127,10 +130,8 @@ precision is limited to microseconds and time range is limited:
127130

128131
In [3]: datetime.MINYEAR
129132
Out[3]: 1
130-
131133
In [4]: datetime.MAXYEAR
132134
Out[4]: 9999
133-
134135
In [5]: datetime.datetime(37337,1,1)
135136
---------------------------------------------------------------------------
136137
ValueError Traceback (most recent call last)
@@ -295,6 +296,8 @@ datetimes in the calculations must be all naive or all aware
295296

296297

297298
Storing datetimes
299+
-----------------
300+
298301
Try to deal in UTC as much as possible. Do not depend on the machine's interpretation of local time.
299302
For instance, datetime.now() on my Mac will return a naive datetime containing the local time. Alternatively:
300303

@@ -344,11 +347,18 @@ are supplied for date and datetime objects
344347
unfortunately, the default implementation does not handle timezone aware
345348
datetimes, but they are simply implementable
346349

347-
let's look at examples/datetime\_naive\_to\_sqlite.py and
348-
examples/datetime\_aware\_to\_sqlite.py
349350

351+
Python Date and Time Useful links
352+
---------------------------------
350353

351-
.. nextslide::
354+
http://agiliq.com/blog/2009/02/understanding-datetime-tzinfo-timedelta-amp-timezo/
355+
356+
https://pymotw.com/3/calendar/index.html
357+
358+
https://pymotw.com/3/datetime/index.html
359+
360+
Dealing with DST and the same time twice in one day
361+
https://www.python.org/dev/peps/pep-0495/
352362

353363
Questions?
354364
----------

0 commit comments

Comments
 (0)