Displaying 20 results from an estimated 3000 matches similar to: "rails timezone difference in console and production application"
2010 Jul 28
3
Rails 3.0.0.rc // rails locales prevent app boot
Hi all,
I got the following error message when booting up my app (which works
fine with Rails 3.0.0.beta4) in Rails 3.0.0.rc;
activesupport-3.0.0.rc/lib/active_support/file_update_checker.rb:27:in
`stat'': can''t convert Array into String (TypeError)
When I put some debug code on that line I see the follwing array being
passed;
2006 Jan 30
1
Introduction & time_zone_select with mapped TimeZone question
I''m new to this list, I''m a student in History, Computerscience and a
bit of Philosophy from the Netherlands... I have started using rails a
few weeks ago, I did read the Agile Webdevelopment with Rails book, and
I generally started to love Rails for it''s sheer beauty and intelligent
structure...
However I came across something that puzzles me quite a bit. It''s
2007 Apr 19
1
Time zone mapping from TimeZone to TZInfo::Timezone
Hi. Using this:
<%= time_zone_select("account", "time_zone" %>
I get a list of time zones options, like eg.:
<option value="Athens">(GMT+02:00) Athens</option>
But as I''m using TZInfo::Timezone, I need to map ''Athens'' to
''Europe/Athens''
I can see that the mapping I''m looking for is
2006 Mar 16
5
TimeZone, TZInfo, daylight savings, and composed_of
Does anyone know the best way to track time zone information. There doesn''t
seem to be much documentation on this. So far it seems like a simple db
field like
create table accounts (
id int unsigned not null auto_increment,
name varchar(50) not null,
time_zone varchar(50) not null,
...
primary key (id)
)
and a class like
class Account < AR
...
2007 Apr 03
1
Some timezone trouble involving tzinfo and postgresql
Friends,
So there I was, minding my own business, trying to make my rails app
timezone aware (DST, as well), since it''s all about the timing with
this one. There are a number of excellent articles that I''ve been
working off of, in particular this one internet archived version of
Scott Barron''s very useful article on the subject that is no longer
available at the
2011 Jan 17
3
Rails 3: Using local timezone on DB
I''m in the process of upgrading my existing Rails 2.3.8 app to Rails
3.0.3.
One problem that I have encountered is how to make rails 3 read/write
date/time data into the DB in localtime.
In Rails 2.3.8, commenting out the ActiveRecord timezone settings did
the trick, however in Rails 3, that doesn''t work as the default is now
UTC.
I have tried setting the config.time_zone to
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
2005 Oct 19
1
TZInfo::Timezone problem selected value
hey, i have a record in the database gtm_zone with value ''Europe/London''
i want to have a select box with all the zones and the corrected selected
@firm.gmt_zone = Europe/London
TimeZone from ruby (trying to expand with TZinfo)
dont want to select Europe/London, and not sorted
<select id="firm_gmt_zone" name="firm[gmt_zone]">
<%=
2011 Nov 11
1
time zone not getting saved in the database
Hello,
Using rails 2.3.9 and ruby 1.8.7
I am trying add time zone in the site according to user''s time zone
(selected by the user from the drop down of time zones)Code is done as
follows, but time zone is not getting saved in the database.
IN Application Controller
before_filter :set_time_zone
def set_time_zone
Time.zone = current_user.time_zone if current_user
end
IN View
2006 Jul 17
0
Weird problem with TimeZone::adjust and TimeZone::unadjust. Please help.
I''m not sure I''m understanding this correctly. I have a user model
that is for all of my user accounts. Each user account has a time
zone. I added this line to automatically create a TimeZone object for
that user using their timezone:
composed_of :tz, :class_name => ''TimeZone'', :mapping => %w(time_zone
name)
I also changed my environment.rb to
why doesn't "config.time_zone = 'location'" ensure Time.now gives the time back in this time zone???
2010 Feb 26
1
why doesn't "config.time_zone = 'location'" ensure Time.now gives the time back in this time zone???
Hi,
I''m after a way of ensuring all my Time work (e.g. using Time.now)
uses the time zone I define as default. To do this I''ve set the
following line in config/environment.rb:
config.time_zone = ''Brisbane''
But even after this, if I open up "./script/console" I note that
Time.now doesn''t work. That is I see:
?> Time.now
=> Thu
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
2009 Mar 20
1
Getting a Time Zone abbreviation from the full name?
There''s got to be an easier way...
I am building an event manager and as part of it, the user selects the
time zone of the event from a drop-down list using the
time_zone_select helper. This is stored in the events table as a
string.
Because of legacy data which is stored in UTC, I want to keep the
dates and times in the table as UTC but when I display it, I want to
show the abbreviated
2010 Apr 16
1
time_zone_select :priority_zones not working properly
I sent this earlier but I don''t think it ever came through. Sorry if this is a reposting.
When using :priority_zones for time_zone_select in a manner described
by the API docs for ActionView::Helpers::FormOptionsHelper I''m getting
errors.
Here is an API docs example:
time_zone_select( "user", ''time_zone'', TimeZone.us_zones, :default =>
2009 Mar 31
2
TimeWithZone seems in rails 2.3 seems broken...is this the correct behavior?
My environment.rb contains
config.time_zone = ''UTC''
If my understanding is correct, rails should assume time values coming
from the database are UTC, and since config.time_zone is set to ''UTC'',
it should not try to convert the times.
Instead, rails is assuming that the db values are Eastern (my local
zone) and is incorrectly adding four hours to convert to
2010 Sep 02
5
Re: Exclude ActiveRecord in Rails3
What''s the best way to exclude ActiveRecord in Rails3?
In Rails2, one could just do:
*config.frameworks -= [ :active_record ]*
in the configuration block in environment.rb. Is it possible in Rails3?
Thanks.
Anuj
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to
2008 Jun 30
1
rake aborted! undefined method `time_zone=' for #
Dear
I have uploaded one project on my account on one of the servers. When
I do migrate
the database rake db:migrate
i get this error
rake aborted! undefined method `time_zone='' for #
any idea on how to solve this problem
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Feb 10
1
config.default_timezone vs. config.time_zone
In config/environment.rb are these statements equivalent?
config.default_timezone = :utc
config.time_zone = "UTC"
If not, then how do they differ in effect?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2006 Mar 15
7
rails on OS X 10.3.9 not working
Hello,
I''ve installed Ruby 1.8.4 via Darwinports, installed gem 0.8.11 too and
then installed Rails via gem. I''m using OS X 10.3.9.
When I now type rails in the terminal, the following lines appear:
# rails
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/values/time_zone.rb:12: undefined method `attr_reamer''
for TimeZone:Class
2011 Apr 14
4
wrong time in application
hey guys,
i''ve got a problem and i really don''t know how to solve it.
when i''m creating a new dataset in my application, the created_at and
updated_at time will be saved in UTF Time (+000).
in my environment.rb i set the following line:
config.time_zone = ''Berlin''
when i''m using the console (script/console) for reading out some example