I have an application that is being built with Django and Django REST Framework. Users can add certain objects to the database and set expiry dates on them. Other users will retrieve those added items from the database and it will be displayed client-side. Both the users creating the objects and the users retrieving them could be in different places of the world.
I plan to store the datetimes in UTC format. How do I make sure that the datetime is in UTC format before storing and when a user tries to retrieve one of these items, it is correctly displayed in their Timezone?
What I am thinking
I am thinking that I should convert it to UTC (client-side) and save that to the database and then when a user retrieves that object I will return it in UTC (from the database) and change the time to the user's local time client-side. Is this a good approach?