Why does Time#to_s(:db) force UTC?

I see in the original commit for Time#to_s in TimeWithZone (https://


022d9f7ce6d1237c4103a2aed561220e1c0f4dcc) to_s(:db) intentionally
forces UTC; conceptually, is there a reason for this? I would expect
it to respect ActiveRecord::Base.default_timezone.

I would file a bug if it weren’t explicitly documented, so there is
some obvious intent. Is there a case where you would want to_s(:db) to
use UTC instead of ::default_timezone ?

-Woody

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs