How to use dateformat in Java?

Use the standard Java DateFormat class. For example to display the current date and time do the following: Date date = new Date(location.getTime()); DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext()); mTimeText.setText("Time: " + dateFormat.format(date));
For More Information Please Refer:


You May Also Like to Read: