Get value of day month from Date object in Android?

前端 未结 10 1985
Happy的楠姐
Happy的楠姐 2020-12-04 10:48

By using this code :

SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");
Date date = format.parse(dtStart);
return date;
10条回答
  •  囚心锁ツ
    2020-12-04 11:41

    In Kotlin you can also get Current Day Name using this. (Requires API level 26)

    (Calendar.getInstance() as GregorianCalendar).toZonedDateTime().dayOfWeek
    

提交回复
热议问题