system.out.println toDate(937150422204)
public static String toDate(Date d)
{
Calendar calendar = Calendar.getInstance();
calendar.setTime(d);
calendar.add(Calendar.MONTH, 1);
calendar.add(Calendar.DAY_OF_MONTH, 1);
String fieldDate = calendar.get(Calendar.DAY_OF_MONTH) + "/" + (calendar.get(Calendar.MONTH)) + "/" + calendar.get(Calendar.YEAR);
return fieldDate;
}
public static String toDate(long d)
{
Date date = new Date(d);
return Resources.toDate(date);
}
Please can someone run the above and tell me the output?

Reply With Quote

