Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

timezones in rails

TZ

Install the tzinfo gem 
Install the tzinfo_timezone rails plugin 
Add a time_zone_id to the accounts (or users) table 
Set ActiveRecord::Base.default_time_zone to :utc 
Define user2utc and utc2user helpers (for converting times between the user’s time zone and UTC) 
Search through the code and find every place that either displays a date/time (strftime, etc.) or stores a user-entered time in the database, and make liberal use of user2utc and utc2user 
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed