Displaying 5 results from an estimated 5 matches for "in_time_zon".
Did you mean:
in_time_zone
2011 Jun 06
0
datetime_select and in_time_zone?
...able and run a before_filter to set the
appropriate time zone so that everything is stored in the database in UTC.
For the ''new'' form and for displaying the times in index and show actions,
no problem at all. When the data is brought back out of the database and
into a view, I use in_time_zone to adjust per the particular venue.
The only issue is on the edit form. The date/time select is showing the data
in UTC. When I''m working on the site, I mentally adjust, but for others it''s
confusing. I''d like to do something along the lines of:
<%= f.datetime_selec...
2011 Dec 07
2
Question About Separation Of Concerns (ActiveRecord)
...trying to do it just simply now in the
models, I think my problem raises a bigger question about Fat Models. But
that''s another subject for another day.
Right now, I have ....
Event
has_many meetings
## has an a invitation_expiry date field.
def invitation_expired?
DateTime.now.in_time_zone(''UTC'') >=
event.invitation_expiry.in_time_zone(''UTC'')
end
Meeting
belongs_to :event
has_many :invitations
def invitation_expired?
event.invitation_expired?
end
Invitation
belongs_to :meeting
My problem is when an invitation is made, I want...
2008 Sep 22
8
TimeZone daylight savings time problems
Here is the following from my console:
>> Time.now
=> Mon Sep 22 11:33:34 +0200 2008
>> Time.now.utc_offset
=> 7200
>> TimeZone[Time.now.utc_offset]
=> #<TimeZone:0x11aea90 @tzinfo=nil, @utc_offset=7200, @name="Athens">
>> Time.now.in_time_zone(TimeZone[Time.now.utc_offset])
=> Mon, 22 Sep 2008 12:34:22 EEST +03:00
(I am in Spain - CET - and running on OS X with the correct timezone)
The Time.now correctly gives me the time, and the correct UTC offset
of 2 hours. It is the summer, so we are 2 hours ahead of UTC. We are
still one hou...
2011 Apr 03
1
Timezone ActiveRecord and Rails3
I want to store, retrieve and handle all times inside my app in just one
Timezone. => "New Delhi"
for that I''ve set in my application.rb file,
config.time_zone = "New Delhi"
When i create a record like
Event.create(:when => DateTime.new(2011, 5, 7, 16, 0, 0))
it creates an event record in my mysql db (local) with "when" field as
"2011-05-07
2013 Feb 07
11
Rails change default time zone.
Hello everyone,
I am using rails 3.2.8.
I want to change time zone to New York time.
I changed following, but didn''t work
#config/application.rb
config.time_zone = ''Eastern Time (US & Canada)''
config.active_record.default_timezone = ''Eastern Time (US & Canada)''
If am wrong please clarify.
Thank You!
--
You received this message