Android Java: Date
Android Java: Date
How can I create a date and calculate the days of the week?
The current day can be obtained as a date variable with Date.
Date dtRow= new Date();
|
Format Date
A Date field can be output as string using the string formatting SimpleDateFormat
SimpleDateFormat
fmtWeekday = new SimpleDateFormat("EE");
|
If you want to be more complex with date, then you have to use the calendar.
To do this, create a calendar with Calendar.getInstance () and then assign a date to this calendar date.
If the date is assigned in the calendar, you can easily use Calendar.get (..) get the individual information about the calendar date.
//*as weekday_number
|
Code example from the Android year calendar project, school calendar
//-< Date >-
|