mardi 20 mars 2018

How to save to Active Record using two different timezones in the same transaction

I have a model which contains two different DateTime properties. One of them needs to be based in one timezone and the other needs to be based in a different timezone, before saving.

I need to tell Rails which timezones are the starting point for each of these properties before it converts them to UTC. Can I do that in the same transaction?

My idea at this point is to set the timezones in different transactions, which I'd like to avoid if possible.

Aucun commentaire:

Enregistrer un commentaire