Also tried the same test with a Time property. The same thing happened.
On Jul 5, 12:01 pm, George <[email protected]> wrote: > After setting and saving a DateTime property, it is always returned > with +01 hour offset. > > Is this by design? It makes comparison of datetime fields rather > tiresome. > (The +1 hour does match the timezone offset of the server but it is > not the time I asked datamapper to store!) > How should I handle datetimes better so I don't hit this problem? > > Here's an example: > trip.start_date = DateTime::civil( 2010, 5, 1, 13, 15, 0, 0 ) > trip.start_date.to_s.should == "2010-05-01T13:15:00+00:00" # PASS > trip.save.should be_true # PASS > trip.reload > trip.start_date.to_s.should == "2010-05-01T13:15:00+00:00" # FAIL > > expected: "2010-05-01T13:15:00+00:00", > got: "2010-05-01T13:15:00+01:00" > > Incidentally the value that is stored in the database does exclude the > offset, so it seems to be added my DM when reading the data. -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
