Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-327

Using Strings to set Time ignores Time.zone

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      SomeDocument.new(:time => '2pm') will always return 2pm in the system's time zone (usually UTC for servers), but should return "2pm" in what ever has been set as Time.zone (US Eastern for example). This is what active record does.

      There are some tests that show this is the expected behavior, or at least that the tests can fail because of timezone changes, but it's not really documented why this decision was made.

            Assignee:
            Unassigned Unassigned
            Reporter:
            gaffneyc Chris Gaffney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: