List of utility methods to do Now
String | getTimeNowAsString(String pattern) get Time Now As String SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(getDateNow()); |
long | getTimeSubFromNowTime(String time) get Time Sub From Now Time int year = Integer.parseInt(getLocationCurrentDate().split("-")[0]); int month = Integer.parseInt(getLocationCurrentDate().split("-")[1]); int day = Integer.parseInt(getLocationCurrentDate().split("-")[2]); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date date = format.parse(year + "-" + month + "-" + day + " " + time); Date now = new Date(); return date.getTime() - now.getTime(); ... |
String | getValidDate(String unknownDate) get Valid Date if (unknownDate == null || !unknownDate.matches("[\\+|-]?[0-9]+")) { return null; Calendar calendar = Calendar.getInstance(); int len = unknownDate.length(); if (len < 4) { int days = Integer.parseInt(unknownDate); calendar.add(Calendar.DAY_OF_MONTH, days); ... |
boolean | isNowInInterval(String start, String end) is Now In Interval return isHourInInterval(getCurrentHour(), start, end);
|
String | makeUniqueName(final String[] knownNames, final String pattern) Computes a unique name using the given known-names array as filter. final HashSet<String> knownNamesSet = new HashSet<String>(knownNames.length); for (int i = 0; i < knownNames.length; i++) { final String name = knownNames[i]; knownNamesSet.add(name); final MessageFormat message = new MessageFormat(pattern); final Object[] objects = { "" }; final String plain = message.format(objects); ... |
String | now() now return now(DEFAULT_TSFORMAT);
|
String | now() Retorna a Data do sistema ignorando a hora minuto segundo. java.util.Date dt = new Date(); String ds = fmt.format(new Date()); return ds; |
String | now() Get a string representation of the the current time Calendar cal = Calendar.getInstance();
return DateFormat.getTimeInstance().format(cal.getTime());
|
String | now() now SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dt = sdf.format(new Date()); return dt; |
String | now() Returns the current Date/Time in "iTunes time format" return formatter.format(new Date()); |