code: def solarTime(utc_dt, lat, lon):
      
      import ephem
      o = ephem.Observer()
      o.date = utc_dt
      o.lat = str(lat)
      o.lon = str(lon)
      sun = ephem.Sun()
      sun.compute(o)
      hour_angle = o.sidereal_time() - sun.ra
      rad = str(ephem.hours(hour_angle + ephem.hours('12:00')).norm)
      t = datetime.strptime(rad, '%H:%M:%S.%f')
      solar_dt = datetime.combine(utc_dt.date(), t.time()) 
      return solar_dt
docs: Compute local solar time for given (lat, lon)