Ruby-on-rails – Use the Rails Society Time Zone in PostgreSQL – the field type to use

I store the time zone in the database I obtained through the FB API. The time zone looks like:

-7 

Which field should I use in rails/PostgreSQL to store this value? string?

If your time zone is always offset, use: decimal (don’t forget the These places are UTC-3.5). Usually, time zone has many different forms:

UTC-3.5
-7
America/Vancouver

So your safest bet is: strings. Olson Database is a good place to learn about the various time zone formats you will encounter.

I store the time zone in the database I get through the FB API. The time zone looks like:

-7

I should be in Which field is used in rails/PostgreSQL to store this value? string?

If your time zone is always offset, then use: decimal (don’t forget that these places in Newfoundland, Canada are UTC-3.5). Usually, the time zone has Many different forms:

UTC-3.5
-7
America/Vancouver

So you are the safest The bet is: strings. Olson Database is a good place to learn about the various time zone formats you will encounter.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3325 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.