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

Timezone Converts to UTC without Timezone

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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?

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

              Created:
              Updated:
              Resolved: