Home »
Code Examples »
Scala Code Examples
Scala - How to get the full month name? Code Example
The code for How to get the full month name?
import java.util.Calendar
import java.util.Locale
object Example {
def main(args: Array[String]) = {
val cal = Calendar.getInstance
val monthName = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault)
println(monthName)
}
}
/*
Output:
August
*/
Code by IncludeHelp,
on August 13, 2022 21:24