Displaying 20 results from an estimated 10000 matches similar to: "Rails 3: Using local timezone on DB"
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
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
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
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
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
...
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
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
2010 Apr 07
2
rails timezone difference in console and production application
Hi all,
I''m on a rails 2.3.5 app. I''ve got my timezone set to ''Brussels'';
config.time_zone = ''Brussels''
When I use mysql I see that a date is stored in UTC (as expected);
e.g. 2010-04-07 15:03:10
When I use console to print out the date it correctly returns;
>> job.created_at.strftime(''%d %b %Y, %H:%M'')
=>
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 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
2006 Jun 07
4
Setting default timezone ENV[''TZ'']=''UTC'' not working on windows?
Hi,
I''ve been trying to do timezone conversion, and have some trouble
getting it to work on my Windows machine. Searching the web, I found
http://wiki.rubyonrails.com/rails/pages/HowtoSetDefaultTimeZone
...which explains how to set the default timezone. I''m using an
environment.rb that include the lines:
ActiveRecord::Base.default_timezone = :utc
ENV[''TZ''] =
2009 Feb 09
3
RSpec Testing ActiveRecord config dependency.
I have the following library code:
def normal_time_now
return DateTime.now.utc if default_timezone == :utc
return DateTime.now
end
This is dependent upon a setting in config/environment.rb
# Make Active Record use UTC-base instead of local time
config.active_record.default_timezone = :utc
I want to test that I get the expected results with the config set to
utc and
2011 Jun 01
4
missing these required gems: will_paginate
Hi EveryBody,
I hope some one help me.
I am new on ROR so might be problem is silly or Obvious. i had
developed a project and i had use "WILL_PAGINATE" plugin in my app.
It''s working well at localhost.
But when deploying on HEROKU, ALL step is going well but when running
$heroku rake db:migrate
ERROR IS
Missing these required gems:
will_paginate
You''re
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
2006 Jun 02
3
Best way to handle different time zones?
We have a project that is hosted in one time zone (say, Pacific Daylight
Time) but the client wants all time recorded in their time zone (say,
Mountain Time). What is the best way to do this? Any recommendations?
Thanks!
Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060602/b995e232/attachment.html
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 Sep 14
9
ActiveRecord::StatementInvalid (invalid date) with Oracle
Hello all. I am a novice Ruby on Rails programmer, starting my first
project using a legacy Oracle 10 database. Using ''reverse_scaffold'' I
have created the models/controllers/views for my existing Oracle
tables.
All seems to work well, using /model/index, /model/show for most of my
tables, *except* when one of the tables contains a Oracle ''date''
column, for
2009 Jul 28
1
Rails date conversion
The environment.rb file in a Rails 2.3.2 app says:
> Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
Auto-convert to this zone... when?
Also, what are the differences between these two statements?
config.time_zone = xxx
config.active_record.default_timezone = xxx
I ask these questions because I have a scenario whereby an AR-backed
object, when