Title: RE: how to get Date,Month... from date
Hi,
 
I think because you have these two import statements in your code,
java.sql.* and java.util.*, (or maybe other packages that have a Date class) 
these both package have the Date class, so just use java.util.Date as the
object reference type instead of Date.
 
regards,
wayan
 
-----Original Message-----
From: Rizwan Ahmed [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 29, 2001 3:47 PM
To: [EMAIL PROTECTED]
Subject: Re: how to get Date,Month... from date

Hi

I used Date class inside the servlet but it says

"The type named date is ambiguous"

I am using Visual Age for Java 3.5 and I think it is not using JDK 1.2

Is it a problem of depreciation or am I missing something?

Thanks

TIA

Rizwan 

> Date date = new Date();

> Calendar cal = Calendar.getInstance();

> cal.setTime(date);

>

> int year = cal.get(Calendar.YEAR);

> int month = cal.get(Calendar.MONTH);

> int day = cal.get(Calendar.DAY_OF_MONTH);

>


Reply via email to