How can I get the current time and date in an Android app?
转载于:https://stackoverflow.com/questions/5369682/get-current-time-and-date-on-android
How can I get the current time and date in an Android app?
转载于:https://stackoverflow.com/questions/5369682/get-current-time-and-date-on-android
You could use:
import java.util.Calendar
Date currentTime = Calendar.getInstance().getTime();
There are plenty of constants in Calendar for everything you need.
Edit:
Check Calendar class documentation