Almost in every app we require time and date so we can fetch them automatically without user interference if you want to know how please follow this tutorial completely.

In general we require Time & Date in many applications so here in this android tutorial i will be showing in general how to get Time and Date.

Starting with this tutorial i want to clarify one thing time and date are fetched from device in android device these time and date are automatically updated from internet.

This tutorial doesn’t require Internet or any thing more just will work with device in getting in device.

timedate

 

MainActivity.java

Fetching the date, week, month, year as

 

Creating activity_main.xml File

 

Here i have designed the screen by adding textviews required and also made the design easily understandable.

activity_main.xml

 

Output 

time&date

If you have any query please comment in below section.

Like and share this tutorial if you like.

 

For more tutorials on date picker visit

http://www.androidcoding.in/date-picker/

 

Show Buttons
Hide Buttons
Read previous post:
Android Tutorial on Listview

Close