There is a code for Android, the goal to display the name of the month:
day_of_month = (TextView)findViewById(R.id.day_of_month); day_of_week = (TextView)findViewById(R.id.day_of_week); String month_s = String.format("%1$tB",new Date()); String day_s = String.format("%1$tA",new Date()); month.setText(month_s); day_of_week.setText(day_s);
Everything is good, except for the case of the month: it is displayed as March, February, September, etc., that is, in the genitive case.
Thanks to the response, the code acquired the following form:
SimpleDateFormat format = new SimpleDateFormat("yyyy;LLLL;dd;EEEE"); String date_string = String.format("%s",format.format(new Date())); String[] date_array = date_string.split(";"); year.setText(date_array[0]); month.setText(date_array[1]); day_of_month.setText(","+date_array[2]); day_of_week.setText(date_array[3]);