File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1111except ImportError :
1212 from bson import Binary
1313
14+ from datetime import datetime , timezone
15+
1416from traitlets import Dict , Instance , List , Unicode
1517
1618from .dictdb import BaseDB
17- from datetime import datetime , timezone
1819
1920# we need to determine the pymongo version because of API changes. see
2021# https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html
2526# MongoDB class
2627# -----------------------------------------------------------------------------
2728
29+
2830def _ensure_utc (obj ):
2931 if isinstance (obj , datetime ):
3032 obj = obj .replace (tzinfo = timezone .utc )
3133 return obj
3234
35+
3336def _ensure_utc_for_record (rec ):
3437 for key in ('submitted' , 'started' , 'completed' , 'received' ):
3538 if key in rec :
You can’t perform that action at this time.
0 commit comments