title: How to test datetime conversion with pytz and tzlocal?
body: <p>So I have datetime objects that I want to show up for users in their local time. </p>
  
  <p>Using answered questions on here, I've come up with a jinja filter to accomplish this:</p>
  
  <pre><code>from tzlocal import get_localzone
  import pytz
  
  def local_datetime(utc_dt):
      local_tz = get_localzone()
      local_dt = utc_dt.replace(tzinfo=pytz.utc).astimezone(local_tz)
      return local_dt.strftime('%m/%d/%y @ %I:%M %p')
  
  app.jinja_env.filters['local_dt'] = local_datetime
  
  {{ user.last_login_at|local_dt }} # in my template
  </code></pre>
  
  <p>My thought was that it would run each time someone views the page (hence the filter) so that it will always show in the user's native timezone. </p>
  
  <p>It shows up right on my development machine, but I'd like to make sure that get_localzone() is actually grabbing the user's local timezone and not always the server's. </p>
  
  <p>My question is: How can I test if this is working correctly? </p>