RBADS RBADS - 1 year ago 65
Android Question

Display the current time and date in an Android application

How do I display the current date and time in an Android application?

Answer Source

Okay, not that hard as there are several methods to do this. I assume you want to put the current date & time into a TextView.

String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());

// textView is the TextView view that should display it

There is more to read in the documentation that can easily be found here . There you'll find more information on how to change the format used for conversion.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download