code: static public String getSFTimestampAsString(
        SFTimestamp sfTS, int columnType, int scale,
        SnowflakeDateTimeFormat timestampNTZFormatter,
        SnowflakeDateTimeFormat timestampLTZFormatter,
        SnowflakeDateTimeFormat timestampTZFormatter,
        SFSession session) throws SFException
    {
      // Derive the timestamp formatter to use
      SnowflakeDateTimeFormat formatter;
      if (columnType == Types.TIMESTAMP)
      {
        formatter = timestampNTZFormatter;
      }
      else if (columnType == SnowflakeUtil.EXTRA_TYPES_TIMESTAMP_LTZ)
      {
        formatter = timestampLTZFormatter;
      }
      else // TZ
      {
        formatter = timestampTZFormatter;
      }
  
      if (formatter == null)
      {
        throw (SFException) IncidentUtil.generateIncidentV2WithException(
            session,
            new SFException(ErrorCode.INTERNAL_ERROR,
                            "missing timestamp formatter"),
            null,
            null);
      }
  
      try
      {
        Timestamp adjustedTimestamp =
            ResultUtil.adjustTimestamp(sfTS.getTimestamp());
  
        return formatter.format(
            adjustedTimestamp, sfTS.getTimeZone(), scale);
      }
      catch (SFTimestamp.TimestampOperationNotAvailableException e)
      {
        // this timestamp doesn't fit into a Java timestamp, and therefore we
        // can't format it (for now). Just print it out as seconds since epoch.
  
        BigDecimal nanosSinceEpoch = sfTS.getNanosSinceEpoch();
  
        BigDecimal secondsSinceEpoch = nanosSinceEpoch.scaleByPowerOfTen(-9);
  
        return secondsSinceEpoch.setScale(scale).toPlainString();
      }
    }
docs: Convert a SFTimestamp to a string value.
  
  @param sfTS                  snowflake timestamp object
  @param columnType            internal snowflake t
  @param scale                 timestamp scale
  @param timestampNTZFormatter snowflake timestamp ntz format
  @param timestampLTZFormatter snowflake timestamp ltz format
  @param timestampTZFormatter  snowflake timestamp tz format
  @param session               session object
  @return timestamp in string in desired format
  @throws SFException timestamp format is missing