本文介紹了如何在 Java 中獲取特定日期對(duì)象的年數(shù)?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時(shí)送ChatGPT賬號(hào)..
假設(shè)您有一個(gè)包含日、月和年值的 Date 對(duì)象.
Say you have a Date object with day, month and year values.
我想知道現(xiàn)在是哪一天.
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.
請(qǐng)不要約達(dá)時(shí)間.(當(dāng)前項(xiàng)目中未使用.)
Please no joda time. ( Not used in the current project. )
推薦答案
Calendar#get(Calendar.DAY_OF_YEAR);
這篇關(guān)于如何在 Java 中獲取特定日期對(duì)象的年數(shù)?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!