-
Re: Dates in Java
Hi All,
I am trying to create a Date object and get
the date in DD-MON-YY format.
I see getDay(), getMonth() and getYear() methods are
depricated.
Any idea how can I go around it ?
Thanks...KW
-
Re: Dates in Java
You would use a SimpleDateFormat object, and in particular its parse()
method.
PC2
"KW" <kishore_wadhare@hotmail.com> wrote in message
news:3cb1f38e$1@10.1.10.29...
>
> Hi All,
> I am trying to create a Date object and get
> the date in DD-MON-YY format.
> I see getDay(), getMonth() and getYear() methods are
> depricated.
> Any idea how can I go around it ?
>
> Thanks...KW
-
Re: Dates in Java
Hi
Look at the java api for SimpleDateFormat class.
It has extensive description with nice examples in its api docu.
Tex...
"KW" <kishore_wadhare@hotmail.com> wrote:
>
>Hi All,
>I am trying to create a Date object and get
>the date in DD-MON-YY format.
>I see getDay(), getMonth() and getYear() methods are
>depricated.
>Any idea how can I go around it ?
>
>Thanks...KW
-
Re: Dates in Java
/* define the formating string (I think the formate is correct for what you
want) */
SimpleDateFormat sTestDateFormat = new SimpleDateFormat("dd-MMM-yy");
// building a date
TimeZone tz = TimeZone.getDefault();
GregorianCalendar cal = new GregorianCalendar(tz, Locale.US);
// printing out the formated date
System.out.println(sTestDateFormat.format(cal.getTime()));
"KW" <kishore_wadhare@hotmail.com> wrote:
>
>Hi All,
>I am trying to create a Date object and get
>the date in DD-MON-YY format.
>I see getDay(), getMonth() and getYear() methods are
>depricated.
>Any idea how can I go around it ?
>
>Thanks...KW
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks