You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`input_formats` designates which input formats are supported. This will override the `DATE_INPUT_FORMATS`
195
-
196
-
-`output_format` designates which output format will be used. This will override the `DATE_OUTPUT_FORMAT`
197
-
198
184
## DateTimeField
199
185
200
186
A date and time representation.
201
187
202
-
Optionally takes `format` as parameter to replace the matching pattern.
203
-
204
188
Corresponds to `django.db.models.fields.DateTimeField`
205
189
206
190
When using `ModelSerializer` or `HyperlinkedModelSerializer`, note that any model fields with `auto_now=True` or `auto_now_add=True` will use serializer fields that are `read_only=True` by default.
@@ -213,11 +197,25 @@ If you want to override this behavior, you'll need to declare the `DateTimeField
*`format` - A string representing the output format. If not specified, the `DATETIME_FORMAT` setting will be used, which defaults to `'iso8601'`.
203
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATETIME_INPUT_FORMATS` setting will be used, which defaults to `['iso8601']`.
204
+
205
+
DateTime format strings may either be [python strftime formats][strftime] which explicitly specifiy the format, or the special string `'is8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used. (eg `'2013-01-29T12:34:56.000000'`)
206
+
207
+
## DateField
208
+
209
+
A date representation.
210
+
211
+
Corresponds to `django.db.models.fields.DateField`
-`input_formats` designates which input formats are supported. This will override the `DATETIME_INPUT_FORMATS`
215
+
*`format` - A string representing the output format. If not specified, the `DATE_FORMAT` setting will be used, which defaults to `'iso8601'`.
216
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATE_INPUT_FORMATS` setting will be used, which defaults to `['iso8601']`.
219
217
220
-
-`output_format` designates which output format will be used. This will override the `DATETIME_OUTPUT_FORMAT`
218
+
Date format strings may either be [python strftime formats][strftime]which explicitly specifiy the format, or the special string `'is8601'`, which indicates that [ISO 8601][iso8601] style dates should be used. (eg `'2013-01-29'`)
221
219
222
220
## TimeField
223
221
@@ -227,11 +225,12 @@ Optionally takes `format` as parameter to replace the matching pattern.
227
225
228
226
Corresponds to `django.db.models.fields.TimeField`
-`input_formats` designates which input formats are supported. This will override the `TIME_INPUT_FORMATS`
230
+
*`format` - A string representing the output format. If not specified, the `TIME_FORMAT` setting will be used, which defaults to `'iso8601'`.
231
+
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `TIME_INPUT_FORMATS` setting will be used, which defaults to `['iso8601']`.
233
232
234
-
-`output_format` designates which output format will be used. This will override the `TIME_OUTPUT_FORMAT`
233
+
Time format strings may either be [python strftime formats][strftime]which explicitly specifiy the format, or the special string `'is8601'`, which indicates that [ISO 8601][iso8601] style times should be used. (eg `'12:34:56.000000'`)
235
234
236
235
## IntegerField
237
236
@@ -276,3 +275,5 @@ Django's regular [FILE_UPLOAD_HANDLERS] are used for handling uploaded files.
0 commit comments