
Hi All,
I am trying to store the date with the timezone.for example, my servers are in Mumbai, when my servers are trying to get the time of America/Detroit. it is not able to get proper time
Here is the snippet and details
def get_created_at(timezone):local_tz = pytz.timezone(timezone)print(datetime.utcnow())created_at = local_tz.localize(datetime.utcnow()).astimezone(tz=pytz.timezone(timezone))return created_at
--
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwQctLvw9KinV8a%3DVTysi_NSNJfu3rodBoBPCY5Cih_ih-DGQ%40mail.gmail.com.
-- Signed email is an absolute defence against phishing. This email has been signed with my private key. If you import my public key you can automatically decrypt my signature and be sure it came from me. Your email software can handle signing.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPUD46vztpvyb8P21vnBf9Wt2d2r6NQ-hgPDD3kyCc%2BpZu3siA%40mail.gmail.com.