- Current month of the year format mm
CURRENT_MONTH_YEAR
Date now = new Date();
int month = now.getMonth() + 1;
String monthStr = month.toString();
if (month < 10) monthStr =
returnValue(monthStr);
- Current year format yyyy
Date now = new Date();
int year = now.getYear() + 1900;
String yearStr = year.toString();
returnValue(yearStr);
- Current month format mm/yyyy
Date now = new Date();
int month = now.getMonth() + 1;
String monthStr = month.toString();
if (month < 10) monthStr =
int year = now.getYear() + 1900;
String toReturn = monthStr +
returnValue(toReturn);
- Current date format dd/mm/yyyy
Date now = new Date();
int day = now.getDate();
String dayStr = day.toString();
if (day < 10) dayStr =
int month = now.getMonth() + 1;
String monthStr = month.toString();
if (month < 10) monthStr =
int year = now.getYear() + 1900;
String toReturn = dayStr +
returnValue(toReturn);