This project is archived and is in readonly mode.
ActiveResource time changed
-
Graphity
Oh, ok, I just saw that adding hours is done by old_time+2.hours Ok, but the bug remains...
-
Geoff Buesing
Ideally, you'd be able to pull together a failing test case to prove this. Second best would be some script/console output that shows the issue.
Also let us know which version of Rails you're using, and, if you're setting config.time_zone, what that's set to. Thanks.
-
Graphity
Ok, I built two RoR Applications (Producer and Consumer). And now I'm uploading both of them in one ZIP (Testcase-942.zip). Try the XML Output, you'll see two different times in the created-at attribute. Sorry if that's the wrong way but it's my first bug report.
-
Graphity
To add to my workaround: First I added the 2hours in a method in controllers/application.rb which, of course, is wrong. Those 2h should be added in the model resulting in a line like def start attributes["start"] = attributes["start"] + 2.hours end
where start is the attribute of type Time.
Oh yes, I' using Rail 2.0.2
-
Graphity
Hm, ok, I just deployed my app to the server and realized there is NO time-shifting. A friend suggested to look at the timezones and, really, there is the difference: My dev-system displays in its XML sth like 2008-09-06T17:45:08+02:00 where my production system displays 2008-09-10T11:28:29+00:00 (mind the +00:00 and +02:00 at the end).
-
Graphity
Ok, so, my current workaround is:
def start attributes["start"] = attributes["start"] + Time.now.gmt_offset endin my model.
I realized, while using the rails console, the server which gets the date from the DB displays
start: 2008-09-10 11:48:00while the server which gets the date from ARes displays
start: 2008-09-10 09:48:00 ZThe timezone in the dev-system says its GMT+1 in Daylight Savings Time while the production-system says UTC
-
Dan Barry
There has been a whole bunch of time zone magic added in Rails 2.1, so you may want to consider upgrading to take advantage of this. Geoff's article about this explains all the new improvements.
-
Pratik
- State changed from new to incomplete
-
Ryan Bigg
- Assigned user set to Mikel Lindsaar
The times returned from the controller should be UTC by default, unless you are setting
Time.zone/config.time_zoneto something else. -
Santiago Pastorino
- State changed from incomplete to open
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
