Returns Time.zone.now when config.time_zone is set, otherwise just returns Time.now
Returns Time.zone.now when config.time_zone is set, otherwise just returns Time.now
I have wrote my first plugin(state_select). This plugin allows to ...
I was using acts_as_searchable for one of my project, which ...
If you guys want to change timezone of your ubuntu ...
My new Notebook Configuration: Intel Core Duo Processor 1.66 GHz, Intel ...
Hey guys, Yesterday I did an interesting server configuration. Actually ...
The asset pipeline which was introduced in Rails 3.1, has ...
#/status/256699237230845952
With the commit c82cf81f00f Action and Page caching has been extracted ...
#/status/253420357841723393
With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...
The asset pipeline which was introduced in Rails 3.1, has ...
#/status/256699237230845952
With the commit c82cf81f00f Action and Page caching has been extracted ...
#/status/253420357841723393
With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...
protip: If your website deals heavily with different Time Zones, you need to use Time.current.to_date instead of Date.today when automatically setting the date for some attribute.
For instance, if your server is in the Eastern Time Zone, and someone is using the system at 11 PM in the Pacific time zone, you will get the wrong date.
Anyone have any comments about overriding Date.today to use Time.current.to_date when config.time_zone is set? Good idea or bad idea that might get you in trouble?
[...] This post was mentioned on Twitter by Akhil Bansal, Rails Bot. Rails Bot said: Edge Rails: Time#current http://bit.ly/bIoEfi [...]
a more concise way to do this is Date.current