[Answered ]-Django python datetime naive and aware

2👍

Docs: link

import datetime
from django.utils.timezone import utc

def time_remaining(self):
    remaining = datetime.datetime.utcnow().replace(tzinfo=utc) - self.timer

    return remaining

Leave a comment