Java Utililty Methods Day

List of utility methods to do Day

Description

The list of methods to do Day are organized into topic(s).

Method

StringgetDay(Date date)
get Day
DateFormat df = new SimpleDateFormat("dd");
df.setLenient(false);
String day = df.format(date);
if (day.startsWith("0"))
    return day.substring(1);
return day;
StringgetDay(Date date)
get Day
return new SimpleDateFormat("dd").format(date);
intgetDay(Date date)
get Day
calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_MONTH);
StringgetDay(Date date)
get Day
return FormatDate(date, "dd");
intgetDay(Date date, HashMap date2day)
get Day
SimpleDateFormat dateformatYYYYMMDD = new SimpleDateFormat("yyyyMMdd");
String today = dateformatYYYYMMDD.format(date);
int day = date2day.get(today);
return day;
java.util.DategetDay(java.util.Date date)
get Day
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.setTime(date);
String s = new java.text.SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
try {
    return sf.parse(s);
} catch (ParseException e) {
    return null;
...
intgetDay(SimpleDateFormat df, String dateStr)
get Day
Calendar c = Calendar.getInstance();
try {
    c.setTime(df.parse(dateStr));
} catch (ParseException e) {
    e.printStackTrace();
return c.get(Calendar.DATE);
intgetDay(String aDate)
get Day
int myDay = -1;
if (isValidObjectModelDate(aDate)) {
    Integer Day = new Integer(aDate.substring(8));
    myDay = Day.intValue();
return myDay;
StringGetDay(String agmipDate)
Get Day
Date date = apsim.parse(agmipDate);
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DAY_OF_YEAR) + "";
intgetDAY(String strDate)
Regresa el dia de la semana, dada la fecha DOMINGO, LUNES, MARTES, MIERCOLES, JUEVES, VIERNES, SABADO
String dia = null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(convertStringToDate(strDate));
return calendar.get(Calendar.DAY_OF_WEEK);