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.


Fetching the date, week, month, year as


[spacer height=”10px”]

[spacer height=”10px”]

Creating activity_main.xml File


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

[spacer height=”10px”]
[spacer height=”10px”]



[spacer height=”10px”]



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


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