How can I utilize SimpleDateFormat with Calendar?

后端 未结 4 1678
长发绾君心
长发绾君心 2020-12-07 22:46

I\'ve got GregorianCalendar instances and need to use SimpleDateFormat (or maybe something that can be used with calendar but that provides required #fromat() feature) to ge

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 23:02

    Simply call calendar.getTime() and pass the resulting Date object to the format method.

提交回复
热议问题