0
votes

Developing a Ruby on Rails application to work in Barbados, I've stumbled upon an issue with timezones.

The timezone in Barbados, officially, is AST (Atlantic Standard Time), which is UTC-4. The string that sets the timezone to AST in the config.time is "Atlantic Time (Canada)".

However, some countries in AST entered Daylight Saving Time yesterday, but not Barbados, which is making records stored in the database appearing with "ADT" (Atlantic Daytime Time) instead of AST, in UTC-3. Are there other timezones that do not appear normally?

1
hello, could you please include the code and additional details of your issue. ThanksFabrizio Bertoglio

1 Answers

2
votes

Short answer: can you use of timezone of America/Barbados instead?


Longer answer

ActiveSupport::TimeZone is a wrapper around TZInfo::Timezone, so you might want to delve into the source to see what's going on.

Finding out the timezone is a bit confusing here - it looks like the timezone of Barbados is listed as Eastern Caribbean on wikipedia, but that redirects to AST with a note that DST is not observed. But setting it to AST in Rails will observe DST by default.

But if you go through the supported timezones in TZInfo, you can see that there are indeed timezones for Barbados and the other countries that share Eastern Caribbean time.

That should work... if not, then it's worth raising on the TZInfo bug tracker.