List of utility methods to do Day
int | dayOfDate(Date s) day Of Date String d = FORMAT_YYYY_MM_DD.format(s);
return Integer.parseInt(d.substring(8, 10));
|
String | dayOfWeekAbr(Date date) returns abbreviated day of week if (date == null) { return ""; return new SimpleDateFormat("EEE").format(date); |
String | daysFrom(Date date, int amount, String format) days From SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(daysFrom(date, amount)); |
Date | daysOfnumbe(Date sDate, int number) days Ofnumbe SimpleDateFormat sdf = new SimpleDateFormat(SHORT_TIME_FORMAT); Calendar c = Calendar.getInstance(); c.add(Calendar.DATE, number); return convertStringToDate(SHORT_TIME_FORMAT, sdf.format(c.getTime())); |
int | daySub(Date fDate, Date oDate) day Sub SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); long to = fDate.getTime(); long from = oDate.getTime(); return (int) (to - from) / (1000 * 60 * 60 * 24); |
List | daysWeekName(boolean shortName, Locale locale) days Week Name int fdow = 1; DateFormatSymbols dfs = null; if (locale != null) { fdow = Calendar.getInstance(locale).getFirstDayOfWeek(); dfs = DateFormatSymbols.getInstance(locale); } else { fdow = Calendar.getInstance().getFirstDayOfWeek(); dfs = DateFormatSymbols.getInstance(); ... |
long | dayToMilliSeconds(String day, String timeZone) Convert String of day to epoch time for targeted time zone. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); simpleDateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); return simpleDateFormat.parse(day).getTime(); |
long | dayToUTCSeconds(String day) Convert String of day to epoch time for UTC return dayToSeconds(day, "UTC"); |
String | getDateYYMMDD() Renvoie la date courante sous le format "yyMMdd" SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); Date currentTime = new Date(); String date = formatter.format(currentTime); return date; |
String | getDateYYMMDD(java.util.Date date) get Date YYMMDD if (date == null) return ""; SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); String NDate = formatter.format(date); return NDate; |