D
D
Denis Zhuravlev2014-10-08 13:47:47
Java
Denis Zhuravlev, 2014-10-08 13:47:47

How to get the month in the nominative case?

Good afternoon.
You need to display the name of the month. I'm using the Calendar class. But it returns not "October", but "October".
How can I get the name of the month in the nominative case?

String currentMonth = calendar.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault());

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vlad20012, 2014-10-08
@vlad20012

Take the month as a number, put the switch on to assign any strings you want ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question