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

Timezone Converts to UTC without Timezone

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Not sure if this is a Mongoid or Rails bug, but I have an "Event" object that has a Time field

      When I try and store
      "Sat Jan 12 2013 14:00:00 GMT-0500 (Eastern Standard Time)"

      What's stored into Mongo (from the console)
      "Sat, 12 Jan 2013 14:00:00 UTC +00:00"

      So you can see it should either be
      Sat, 12 Jan 2013 19:00:00 UTC +00:00
      or
      Sat, 12 Jan 2013 09:00:00 EST -05:00

      I've tried in my applicaiton.rb:
      config.time_zone = 'Eastern Time (US & Canada)'
      config.local_zone = 'Eastern Time (US & Canada)'
      Time.zone = 'Eastern Time (US & Canada)'
      Mongoid::Config.use_utc = false
      Mongoid::Config.use_activesupport_time_zone = true

      No dice. Is this a bug in Mongoid or a bug in my settings?

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            k2xl k2xl
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: