Вы можете попробовать следующие методы для того же,
public static String getDate(long currentTimeMillis)
{
Date today = new Date(currentTimeMillis);
DateField date = new DateField( "", DateField.DATE_TIME, TimeZone.getTimeZone("GMT+5:30") );
date.setDate(today);
Calendar cal = Calendar.getInstance();
cal.setTime(today);
String dateStr = "" + getTwoDigitStr(cal.get(Calendar.DATE)) + "-" + getTwoDigitStr(cal.get(Calendar.MONTH)+1) + "-" + cal.get(Calendar.YEAR);
return dateStr;
}
public static String getTime (long currentTimeMillis )
{
Date today = new Date(currentTimeMillis);
DateField date = new DateField ( "", DateField.TIME, TimeZone.getTimeZone("GMT +5:30") );
date.setDate(today);
Calendar cal = Calendar.getInstance();
cal.setTime(today);
String timeStr = "" + cal.get( Calendar.HOUR) + ":" + cal.get( Calendar.MINUTE );
return timeStr;
}