Get Current Date in Android Programmatically
http://www.viralandroid.com/2015/11/get-current-date-in-android-programmatically.html
In this example, I will show how to get (display) current date in android application programmatically. To get current date(today's date) in android application, we use Calendar class Calendar calendar = Calendar.getInstance();.
Related:
Get Current Time in Android Programmatically
How to Make a Phone Call in Android
Android Material Design with Design Support Library
XML Layout File
res/layout/activity_main.xml
Java Activity File
src/MainActivity.java
Now, run your application and click the Get Current Date button to get today’s date.
Output:
Related:
Get Current Time in Android Programmatically
How to Make a Phone Call in Android
Android Material Design with Design Support Library
Android Example: How to Get (display) Current Date in Android Programmatically
XML Layout File
res/layout/activity_main.xml
Java Activity File
src/MainActivity.java
Now, run your application and click the Get Current Date button to get today’s date.
Output:
Current Date in Android |