new_contents: #!/usr/bin/python3
  '''
   ====================================================================
   Copyright (c) 2016 Barry A Scott.  All rights reserved.
  
   This software is licensed as described in the file LICENSE.txt,
   which you should have received as part of this distribution.
  
   ====================================================================
  
      wb_date.py
  
  '''
  import datetime
  import pytz
  import tzlocal
  
  def utcDatetime( timestamp ):
      return pytz.utc.localize( datetime.datetime.utcfromtimestamp( timestamp ) )
  
  def localDatetime( datetime_or_timestamp ):
      if type(datetime_or_timestamp) in (int, float):
          dt = utcDatetime( datetime_or_timestamp )
      else:
          dt = datetime_or_timestamp
  
      local_timezone = tzlocal.get_localzone()
      local_dt = dt.astimezone( local_timezone )
      return local_dt
  
  if __name__ == '__main__':
      import time
  
      t = time.time()
  
      utc = utcDatetime( t )
      print( '   UTC: repr %r' % (utc,) )
      print( '   UTC:  str %s' % (utc,) )
  
      local = localDatetime( utc )
      print( 'Local1: repr %r' % (local,) )
      print( 'Local1:  str %s' % (local,) )
  
      local = localDatetime( t )
      print( 'Local2: repr %r' % (local,) )
      print( 'Local2:  str %s' % (local,) )
  
subject: Add wb_date to handle all the details of going from a utc timestamp to a local timezone datetime object.