Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-125

return UTC/aware datetimes

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Major Change

      It seems odd and imprecise for a UTC/aware datetime to become tz-naive after a trip through pymongo. If I'm going to the trouble to make all the dates in my system tz-aware, pymongo ought to not mess things up by returning naive ones, right?

      In the opposite case, when I put a naive datetime into mongo, I don't mind so much that pymongo calls it UTC/aware when the value comes back out. That's what other non-python readers were going to assume about the datetime anyway.

      The most casual programmers, who use naive datetimes for their local time zone, will presumably also not care if the values out of pymongo have some tz bits set incorrectly. And if they do, the fix will be for them to simply be more explicit about the values they pass in, which I think is a reasonable thing to ask.

            Assignee:
            mike Michael Dirolf
            Reporter:
            drewp Drew Perttula
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: