List of utility methods to do Date to Time
String | getTime(final Date time) Builds a string in the SimpleDateFormat of yyyyMMdd'T'HHmmss return OBEX_DATE_FORMAT.format(time);
|
String | getTime(java.util.Date date) get Time return formatDateHMS(date);
|
String | getTime(java.util.Date date) get Time return format(date, "HH:mm:ss"); |
String | getTime(java.util.Date date) get Time return format(date, "HH:mm:ss"); |
Long | getTimeAsMilliSeconds(Date dateTime) Returns the seconds of the time without date {Category} TimestampUtil {talendTypes} Long {param} Date(today): The timestamp within a timeframe. if (dateTime != null) { java.util.Calendar c = java.util.Calendar.getInstance(Locale.GERMAN); c.setTime(dateTime); c.setTimeZone(getUTCTimeZone()); c.set(java.util.Calendar.YEAR, 1970); c.set(java.util.Calendar.DAY_OF_YEAR, 1); return c.getTime().getTime(); } else { ... |
String | getTimeAsString(Date date) get Time As String String value = null; if (date != null) { value = TIME_FORMAT.format(date); return value; |
String | getTimeAsXsdDateTime(Date d) Format the Date as xsd:DateTime. SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); SimpleDateFormat sdf2 = new SimpleDateFormat("Z"); String one = sdf1.format(d.getTime()); String offset = sdf2.format(d.getTime()); String offsetA = offset.substring(0, 3); String offsetB = offset.substring(3); return one + offsetA + ":" + offsetB; |
long | getTimeBackInMillis(final int granularity, final int numberToBack, final Date date) get Time Back In Millis Calendar calendar = buildCalendar(date); calendar.add(granularity, -numberToBack); long timeBackInMillis = calendar.getTimeInMillis(); return timeBackInMillis; |
Long | getTimeBoxValue(TimeZone zone, Date date) Returns an appropriate value for the UTCTimeBox for a specified TimeZone and Date . if (date == null) return null; Calendar cal = GregorianCalendar.getInstance(zone); cal.setTime(date); int hours = cal.get(Calendar.HOUR_OF_DAY); int minutes = cal.get(Calendar.MINUTE); int seconds = cal.get(Calendar.SECOND); int millis = cal.get(Calendar.MILLISECOND); ... |
String | getTimeByCustomPattern(Date date, String pattern) get Time By Custom Pattern return new SimpleDateFormat(pattern).format(date); |