@@ -139,8 +139,14 @@ US/Eastern time zone.
139
139
140
140
So assuming the date was 2015-01-01, we would be saving the following values to
141
141
the database:
142
- ``LocationReportingPeriod.start ``: ``datetime.datetime(2015, 1, 1, 0, 0, tzinfo=<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>) ``
143
- ``LocationReportingPeriod.end ``: ``datetime.datetime(2015, 1, 1, 23, 59, 59, 999999, tzinfo=<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>) ``
142
+
143
+ .. code-block :: python
144
+
145
+ # LocationReportingPeriod.start
146
+ datetime.datetime(2015 , 1 , 1 , 0 , 0 , tzinfo = < DstTzInfo ' US/Eastern' EST - 1 day, 19 :00 :00 STD > )
147
+
148
+ # LocationReportingPeriod.end
149
+ datetime.datetime(2015 , 1 , 1 , 23 , 59 , 59 , 999999 , tzinfo = < DstTzInfo ' US/Eastern' EST - 1 day, 19 :00 :00 STD > )
144
150
145
151
For each location, let's say that the client wants to see the start and end of
146
152
the reporting period in that location's time zone. One thing to remember is that
@@ -149,11 +155,11 @@ particular time zone, it does not mean that they will come that way from the
149
155
database. For example, if your application's settings.TIME_ZONE is set to
150
156
``UTC ``, you would get back:
151
157
152
- .. code block:: python
153
-
158
+ .. code- block :: python
159
+
154
160
print (period.start)
155
161
datetime.datetime(2015 , 1 , 1 , 5 , 0 , tzinfo = < UTC > )
156
-
162
+
157
163
print (period.end)
158
164
datetime.datetime(2015 , 1 , 2 , 4 , 59 , 59 , 999999 , tzinfo = < UTC > )
159
165
@@ -187,7 +193,7 @@ Here is how we would handle the displaying conversions from view to template:
187
193
.. code-block :: django
188
194
189
195
{% load tz %}
190
- {% load i81n %}
196
+ {% load i18n %}
191
197
192
198
{% block content %}
193
199
<table>
0 commit comments