Displaying 3 results from an estimated 3 matches for "getutc".
2007 Nov 18
0
Trouble overriding default accessor/mutator
...a duration value as a number of
seconds, but I''d like users to be able to see it and edit it as a time
value. I am trying to override the default accessor/mutator for the
attribute and do the conversions there, using something that looks
like:
def duration
Time.at(self[:duration].to_i).getutc
end
def duration=(value)
self[:duration] = value.to_i
end
Everything seems OK, but when I go to save the record, I get the
following:
ActiveRecord::MultiparameterAssignmentErrors in
AdminController#update
1 error(s) on assignment of multiparameter attributes
What am I missing?
--~--~----...
2007 Nov 20
9
Timestamping in log file?
Hi,
I''m wondering if it''s easy to add timestamps to the mongrel log? I am
having a problem where an externally spawned application by Rails is
failing. Mongrel kindly logs the error message returned by this
application when it fails. But it doesn''t record a timestamp as to when
the error occurs, which makes it a little tricky to sync this up to my
webserver logs to
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database
and I''m hoping someone can help.
MySQL stores the date/time as this:
2005-03-08 17:00:34.0
and according to my Pickaxe book Ruby stores times as "the number of
seconds and microseconds since [...] January 1, 1970". All well and good.
Unfortunately, RoR is converting my date to this: