code: def append_tz_timestamp(self, tag, timestamp=None, precision=3,
                              header=False):
          
  
          # Get float offset from Unix epoch.
          if timestamp is None:
              now = time.time()
          elif type(timestamp) is float:
              now = timestamp
          else:
              now = time.mktime(timestamp.timetuple()) + \
                    (timestamp.microsecond * 1e-6)
  
          # Get offset of local timezone east of UTC.
          utc = datetime.datetime.utcfromtimestamp(now)
          local = datetime.datetime.fromtimestamp(now)
          td = local - utc
          offset = int(((td.days * 86400) + td.seconds) / 60)
  
          s = local.strftime("%Y%m%d-%H:%M:%S")
          if precision == 3:
              s += ".%03u" % (local.microsecond / 1000)
          elif precision == 6:
              s += ".%06u" % local.microsecond
          elif precision != 0:
              raise ValueError("Precision (%u) should be one of "
                               "0, 3 or 6 digits" % precision)
  
          s += self._tz_offset_string(offset)
          return self.append_pair(tag, s, header=header)
docs: Append a field with a TZTimestamp value, derived from local time.
  
          :param tag: Integer or string FIX tag number.
          :param timestamp: Time value, see below.
          :param precision: Number of decimal places: 0, 3 (ms) or 6 (us).
          :param header: Append to FIX header if True; default to body.
  
          The `timestamp` value should be a local datetime, such as created
          by datetime.datetime.now(); a float, being the number of seconds
          since midnight 1 Jan 1970 UTC, such as returned by time.time();
          or, None, in which case datetime.datetime.now() is used to get
          the current local time.
  
          Precision values other than zero (seconds), 3 (milliseconds),
          or 6 (microseconds) will raise an exception.  Note that prior
          to FIX 5.0, only values of 0 or 3 comply with the standard.