long time=1434624342;
Calendar cal = Calendar.getInstance(Locale.ENGLISH);
cal.setTimeInMillis(time);
String date = DateFormat.format("dd-MM-yyyy hh:mma", cal).toString();
Date and Time Format : 18-06-2015 10:47AM
If timestamp is String then convert to long by:
String timestamp=Long.parseLong(long_value);
Note: import
import java.util.Calendar;
import java.util.Locale;
NOTE: If any issue to implement this code then please comment...
No comments :
Post a Comment