Storing the time zone with Rails in PostgreSQL - what type of field to use

I store timezones in my database, which I get through the FB api. The time zone is as follows:

-7 

Which field should be used in rails / PostgreSQL to store this value? Line?

+3
source share
1 answer

If your time zone will always be an offset, use :decimal(don't forget about places like Newfoundland Canada that are in UTC-3.5). Usually time zones come in many forms:

UTC-3.5
-7
America/Vancouver

, :string. Olson Database - , , .

+7

All Articles