Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object, using the given Calendar object to construct the Timestamp object.
188832
@Override
    public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
216499
@Override
    public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_TIMESTAMP : x;
    }
1192831
protected Calendar createJavaCalendar (final long timeStamp)
  {
    final Calendar calendar = createJavaCalendar ();
    calendar.setTime (new Date (timeStamp));
    return calendar;
  }
844626
public static Timestamp toSqlTimestamp(Instant instant) {
        try {
            Timestamp ts = new Timestamp(instant.getEpochSecond() * 1000);
            ts.setNanos(instant.getNano());
            return ts;
        } catch (ArithmeticException ex) {
            throw new IllegalArgumentException(ex);
        }
    }
715932
public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
    {
        if (this.isNull())
        {
            if ((!this.isNullable())
                || (iType == DBConstants.SQL_SELECT_TYPE)
                || (DBConstants.FALSE.equals(this.getRecord().getTable().getDatabase().getProperties().get(SQLParams.NULL_TIMESTAMP_SUPPORTED)))) // HACK for Access
            {   // Access does not allow you to pass a null for a timestamp (must pass a 0)
                java.sql.Timestamp sqlDate = new java.sql.Timestamp(0);
                statement.setTimestamp(iParamColumn, sqlDate);
            }
            else
                statement.setNull(iParamColumn, Types.TIME);
        }
        else
        {
            java.sql.Time sqlTime = new java.sql.Time((long)this.getValue());
            statement.setTime(iParamColumn, sqlTime);
        }
    }
263268
def cast_callback(value):
        
        # Postgresql / MySQL drivers change the format on 'TIMESTAMP' columns;

        if 'T' in value:
            value = value.replace('T', ' ')

        return datetime.strptime(value.split('.')[0], '%Y-%m-%d %H:%M:%S')
197964
public static Timestamp convertDateToTimestamp(Date date, Timestamp elseValue) {
        return Checker.isNull(date) ? elseValue : new Timestamp(date.getTime());
    }
1213314
static SQLTransform getSqlTransform(TypeName typeName) {
		if (Time.class.getName().equals(typeName.toString())) {
			return new SQLTimeSQLTransform();
		}

		if (java.sql.Date.class.getName().equals(typeName.toString())) {
			return new SQLDateSQLTransform();
		}

		return null;
	}
1356849
public static java.sql.Date getSqlDate(int year, int month, int date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new java.util.Date(0));
        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, month - 1);
        cal.set(Calendar.DATE, date);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);

        return getSqlDate(cal.getTime());
    }
877005
def get_timestamp(timezone_name, year, month, day, hour=0, minute=0):
    """"""
    tz = pytz.timezone(timezone_name)
    tz_datetime = tz.localize(datetime(year, month, day, hour, minute))
    timestamp = calendar.timegm(tz_datetime.utctimetuple())
    return timestamp
1134744
public static java.sql.Date getSqlDate(java.util.Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return new java.sql.Date(cal.getTimeInMillis());
    }
407272
public static Object[] getSqlParams(String sqlPattern, Map map) {
        Object[] sqlParams = JdbcPatternUtil.getValues(JdbcPatternUtil.getCamelKeys(sqlPattern), map).toArray();
        for (int i = 0; i < sqlParams.length; i++) {
            if (sqlParams[i] instanceof Calendar) {//因为prepared statement不支持calendar类型,所以需要将其其中的calendar转为date
                sqlParams[i] = ((Calendar) sqlParams[i]).getTime();
            }
        }
        return sqlParams;
    }
983996
public static final String printTimestamp(Date value)
   {
      return (value == null ? null : TIMESTAMP_FORMAT.get().format(value));
   }
765915
public RowBuilder timestampCol(String name)
  {
    Column column = new ColumnTimestamp(_columns.size(), name, _offset);
    
    _offset += column.length();
    _columns.add(column);
    
    return this;
  }
667302
def timestamp(value, timezone=None):
    
    if isinstance(value, str):
        try:
            value = pd.Timestamp(value, tz=timezone)
        except pd.errors.OutOfBoundsDatetime:
            value = dateutil.parser.parse(value)
    if isinstance(value, numbers.Integral):
        raise TypeError(
            (
                "Passing an integer to ibis.timestamp is not supported. Use "
                "ibis.literal({value:d}).to_timestamp() to create a timestamp "
                "expression from an integer."
            ).format(value=value)
        )
    return literal(value, type=dt.Timestamp(timezone=timezone))
999380
public static java.sql.Timestamp getTimestamp(Object value) {
        try {
            return toTimestamp(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
828556
public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
      throws SQLException {
    if (lastValueWasNull()) {
      return null;
    }

    if (columnInfo.getColumnType() == ColumnType.TIMESTAMP
        || columnInfo.getColumnType() == ColumnType.DATETIME) {
      Timestamp timestamp = getInternalTimestamp(columnInfo, cal, timeZone);
      return (timestamp == null) ? null : new Time(timestamp.getTime());

    } else if (columnInfo.getColumnType() == ColumnType.DATE) {

      throw new SQLException("Cannot read Time using a Types.DATE field");

    } else {
      String raw = new String(buf, pos, length, StandardCharsets.UTF_8);
      if (!options.useLegacyDatetimeCode && (raw.startsWith("-") || raw.split(":").length != 3
          || raw.indexOf(":") > 3)) {
        throw new SQLException("Time format \"" + raw + "\" incorrect, must be HH:mm:ss");
      }
      boolean negate = raw.startsWith("-");
      if (negate) {
        raw = raw.substring(1);
      }
      String[] rawPart = raw.split(":");
      if (rawPart.length == 3) {
        int hour = Integer.parseInt(rawPart[0]);
        int minutes = Integer.parseInt(rawPart[1]);
        int seconds = Integer.parseInt(rawPart[2].substring(0, 2));
        Calendar calendar = Calendar.getInstance();
        if (options.useLegacyDatetimeCode) {
          calendar.setLenient(true);
        }
        calendar.clear();
        calendar.set(1970, Calendar.JANUARY, 1, (negate ? -1 : 1) * hour, minutes, seconds);
        int nanoseconds = extractNanos(raw);
        calendar.set(Calendar.MILLISECOND, nanoseconds / 1000000);

        return new Time(calendar.getTimeInMillis());
      } else {
        throw new SQLException(
            raw + " cannot be parse as time. time must have \"99:99:99\" format");
      }
    }

  }