本文介紹了如何在 Java 中獲取特定日期對象的年數?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
假設您有一個包含日、月和年值的 Date 對象.
Say you have a Date object with day, month and year values.
我想知道現在是哪一天.
I want to know which date it is.
我的意思是,例如 3 月 5 日是一年中的第 65 日.或者就像 1 月 15 日是 15 日一樣.
By this I mean, like 5th of March is for example the 65th of the year. Or like 15th of January is the 15th.
請不要約達時間.(當前項目中未使用.)
Please no joda time. ( Not used in the current project. )
推薦答案
Calendar#get(Calendar.DAY_OF_YEAR);
這篇關于如何在 Java 中獲取特定日期對象的年數?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!