File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,38 @@ def __eq__(self, other: Any) -> Any:
200
200
201
201
202
202
class DatetimeConversionOpts (enum .IntEnum ):
203
+ """Options for decoding BSON datetimes."""
204
+
203
205
DATETIME = 1
206
+ """Decode a BSON UTC datetime as a :class:`datetime.datetime`.
207
+
208
+ BSON UTC datetimes that cannot be represented as a
209
+ :class:`~datetime.datetime` will raise an :class:`OverflowError`
210
+ or a :class:`ValueError`.
211
+
212
+ .. versionadded 4.3
213
+ """
214
+
204
215
DATETIME_CLAMP = 2
216
+ """Decode a BSON UTC datetime as a :class:`datetime.datetime`, clamping
217
+ to :attr:`~datetime.datetime.min` and :attr:`~datetime.datetime.max`.
218
+
219
+ .. versionadded 4.3
220
+ """
221
+
205
222
DATETIME_MS = 3
223
+ """Decode a BSON UTC datetime as a :class:`~bson.datetime_ms.DatetimeMS`
224
+ object.
225
+
226
+ .. versionadded 4.3
227
+ """
228
+
206
229
DATETIME_AUTO = 4
230
+ """Decode a BSON UTC datetime as a :class:`datetime.datetime` if possible,
231
+ and a :class:`~bson.datetime_ms.DatetimeMS` if not.
232
+
233
+ .. versionadded 4.3
234
+ """
207
235
208
236
209
237
class _BaseCodecOptions (NamedTuple ):
You can’t perform that action at this time.
0 commit comments