title: convert timestamp in utc timezone to a given timezone
body: <p>python version: 3.7</p>
  <p>I am trying to convert utc timestamps to a given timezone using <code>pytz</code> and <code>astimezone</code>.</p>
  <p>(I have timestamps stored in my db in utc timezone and I amtrynig to convert them)</p>
  <p><strong>For example:</strong></p>
  <ul>
  <li>converting '2022-07-18 19:43:26.164345' timestamp to <code>'US/Pacific'</code> timezone will result '2022-07-18 12:43:26.164345-07:00' <br></li>
  <li>converting '2022-07-18 19:43:26.164345' timestamp to <code>'UTC'</code> timezone will <strong>not</strong> affect any change - will result '2022-07-18 19:43:26.164345'</li>
  </ul>
  <p>here is what I tried:</p>
  <pre><code>import pytz
  
  def convert_utc_timestamp_to_timezone(utc_timestamp, dt_timezone):
    return utc_timestamp.astimezone(pytz.timezone(dt_timezone))
  </code></pre>
  <p>expected:</p>
  <pre><code>&gt; dt = datetime.datetime.now()
  &gt; convert_utc_timestamp_to_timezone(dt, 'UTC') // expected result: dt
  </code></pre>
  <p>but no.., actual result::</p>
  <pre><code>&gt; dt = datetime.datetime.now()
  &gt; converted = convert_utc_timestamp_to_timezone(dt, 'UTC')
  &gt; print(dt) # 2022-07-18 23:10:34.061169
  &gt; print(converted) # 2022-07-18 20:10:34.061169+00:00
  # dt != converted not as I expect
  
  </code></pre>
  <p>This works when my local timezone is set to utc - for example when running on online browser <br></p>
  <pre><code>import datetime
  import pytz
  
  
  def convert_utc_timestamp_to_timezone(utc_timestamp, dt_timezone):
    return utc_timestamp.astimezone(pytz.timezone(dt_timezone))
    
  dt = datetime.datetime.utcnow()
  a = convert_utc_timestamp_to_timezone(dt, 'US/Pacific')
  
  print('in utc timezone',dt)
  print('after convert to US/Pacific timezone: ',a)
  
  
  # results:
  #in utc timezone 2022-07-18 20:18:37.253062
  # after convert to US/Pacific timezone:  2022-07-18 13:18:37.253062-07:00
  
  dt2 = datetime.datetime.utcnow()
  a2 = convert_utc_timestamp_to_timezone(dt, 'UTC')
  print('in utc timezone', dt2)
  print('after convert to UTC timezone: ',a2)
  # results:
  # in utc timezone 2022-07-18 20:18:37.264363
  # after convert to UTC timezone:  2022-07-18 20:18:37.253062+00:00
  </code></pre>
  <p>But does not work well when running locally - since my pc timezone isn't utc <br>
  (the doc actually states that <code>astimezone</code> “converts to local time”) <br></p>
  <pre><code>import pytz
  def convert_utc_timestamp_to_timezone(utc_timestamp, dt_timezone):
      return utc_timestamp.astimezone(pytz.timezone(dt_timezone))
  dt = datetime.datetime.utcnow()
  a = convert_utc_timestamp_to_timezone(dt, 'US/Pacific')
  print('in utc timezone', dt)
  print('after convert to US/Pacific timezone: ', a)
  
  # result:
  # in utc timezone 2022-07-18 20:22:05.526588
  # after convert to US/Pacific timezone:  2022-07-18 10:22:05.526588-07:00
  
  dt2 = datetime.datetime.utcnow()
  a2 = convert_utc_timestamp_to_timezone(dt, 'UTC')
  print('in utc timezone', dt2)
  print('after convert to UTC timezone: ', a2)
  
  # result:
  # in utc timezone 2022-07-18 20:22:05.576213
  # after convert to UTC timezone:  2022-07-18 17:22:05.526588+00:00
  </code></pre>
  <p>what is the correct way to convert timestamp in utc timezone to a given timezone? <br>
  I tried pytz <code>localize</code> , but also doesn't give expected result</p>