What is the easiest way to get the current day of the week in Android?

前端 未结 11 1552
南方客
南方客 2020-11-27 02:44

What would be the easiest way to get the current day of the week in Android?

11条回答
  •  青春惊慌失措
    2020-11-27 03:15

    Java 8 datetime API made it so much easier :

    LocalDate.now().getDayOfWeek().name()
    

    Will return you the name of the day as String

    Output : THURSDAY

提交回复
热议问题