public class DateFormatter {
private final static SimpleDateFormat formatYYMMDD = new SimpleDateFormat("yyyy/MM/dd");
private final static SimpleDateFormat formatDDMMYY = new SimpleDateFormat("dd/MM/yyyy");
-
+
/*
* convert String date into long date (miliseconds since the epoch start)
*/
}
return dateWorkSt;
}
-
+
/*
- * date validator
- * true - if valid date, false - if invalid
+ * date validator true - if valid date, false - if invalid
*/
public static boolean isThisDateValid(String dateToValidate, SimpleDateFormat sdf) {
if (dateToValidate == null || dateToValidate.equals("")) {
}
return true;
}
-
+
/*
* convert date from long to String
*/
String dateString = formatter.format(new Date(indate));
return dateString;
}
-
+
public static SimpleDateFormat getFormatYYMMDD() {
return formatYYMMDD;
}
-
+
public static SimpleDateFormat getFormatDDMMYY() {
return formatDDMMYY;
}