Thursday, June 22, 2017

Re: Model with mix of timezone aware and naive datetimes?

On Thursday 22 June 2017 15:19:18 Antonis Christofides wrote:

 

> BTW, your decision to use a naive time for departure and arrival is

> going to give you headaches unless you can be absolutely certain that

> you will never have a departure or arrival that occurs during the

> ambiguous hour during the autumn switch to standard time.

 

Naive times are fine, as long as you convert to UTC before saving and treat them as in UTC when loading. Of course, Django aware does this for you, but if your input (like from an external source) is guaranteed to be UTC then save some electrons.

--

Melvyn Sopacua

No comments:

Post a Comment