當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Java Date getDate()用法及代碼示例

Java Date 類的 getDate() 方法返回 1 到 31 之間的值,該值代表此日期對象的月份中的第幾天。此方法自 JDK 1.1 版起已棄用,並由 Calender.get(Calender.DAY_OF_MONTH) 取代

用法:

@Deprecated
public int getDate()

參數

NA

返回

它返回此日期對象表示的月份中的第幾天。

示例

import java.util.Date;

public class JavaDateGetDateExample1 {

	public static void main(String[] args) {
		Date d=new Date();
		System.out.println("date of the month is :"+d.getDate());
		}
}

輸出:

date of the month is :26






相關用法


注:本文由純淨天空篩選整理自 Java Date getDate() Method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。