List of utility methods to do SQL Date
Date | getYearLater() get Year Later Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + 1); Date date = new Date(calendar.getTimeInMillis()); return date; |
String | hexToBin(String sHexString) This method is used to convert hexcidecimal to binary string String sBinString = ""; for (int i = 0; i < sHexString.length(); i++) sBinString += hexCharToBin(sHexString.charAt(i)); return sBinString; |
boolean | isLastDayOfMonth(String theDataStr) is Last Day Of Month Date theDate = java.sql.Date.valueOf(theDataStr); Calendar c = new GregorianCalendar(); c.setTime(theDate); int nowDay = c.get(Calendar.DAY_OF_MONTH); c.set(Calendar.DAY_OF_MONTH, 1); c.add(Calendar.MONTH, 1); c.add(Calendar.DAY_OF_MONTH, -1); int lowDayOfMonth = c.get(Calendar.DAY_OF_MONTH); ... |
boolean | isSimpleColumnType(Class> columnType) is Simple Column Type return columnType.isPrimitive() || columnType.equals(String.class) || columnType.equals(Integer.class) || columnType.equals(Long.class) || columnType.equals(Date.class) || columnType.equals(java.sql.Date.class) || columnType.equals(Boolean.class) || columnType.equals(Float.class) || columnType.equals(Double.class) || columnType.equals(Byte.class) || columnType.equals(Short.class) || columnType.equals(CharSequence.class) || columnType.equals(Character.class); |
boolean | isSimpleType(Object obj) is Simple Type if (obj == null) return true; return obj instanceof String || obj instanceof Integer || obj instanceof Long || obj instanceof Float || obj instanceof Double || obj instanceof Boolean || obj instanceof Locale || obj instanceof Date || obj instanceof Time; |
java.sql.Date | issue20() issue return null;
|
java.util.Date | now() now return java.sql.Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
|
java.sql.Date | nowPlus(int parts, int value) convienence routine to return current time plus argument amount Calendar now = GregorianCalendar.getInstance(utcTZ); now.add(parts, value); java.sql.Date sqlNow = new java.sql.Date(now.getTime().getTime()); return sqlNow; |
T | parseStringValue(Class Tries to parse a String into the desired object. T objValue = null; if (returnType == null) { throw new IllegalArgumentException("Parameter (Class<T> returnType) is null."); if ((!returnType.isPrimitive()) && value == null) { return null; if (char[].class.equals(returnType)) { ... |
String | serialize(Instant sourceValue) serialize if (sourceValue.getNano() == 0) { return ISO_DATE_FORMAT_SECONDS.format(sourceValue); return ISO_DATE_FORMAT_MILLIS.format(sourceValue); |