Java 日期與日曆 - Java Date vs Calendar

語言: CN / TW / HK

問題:

Could someone please advise the current "best practice" around Date and Calendar types.有人可以建議當前關於DateCalendar型別的“最佳實踐”。

When writing new code, is it best to always favour Calendar over Date , or are there circumstances where Date is the more appropriate datatype?在編寫新程式碼時,最好總是使用Calendar不是Date ,還是在某些情況下Date是更合適的資料型別?


解決方案:

參考一: https://stackoom.com/question/5tIY
參考二: Java Date vs Calendar
「其他文章」