Advertisement
robertvari

UTC to local timezone

Jan 21st, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. def __str__(self):
  2.     utc = self.start_date.replace(tzinfo=pytz.UTC)
  3.     localtz = utc.astimezone(timezone.get_current_timezone())
  4.     return localtz.strftime('%Y %h. %d %H:%M')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement