Get your CodeRanch badge!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Date Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Date Question" Watch "Date Question" New topic
Author

Date Question

Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
Hi All,

How can i get the System Date(current Date ) in yyyy-mm-dd format?

Help me pls.

Thanks in Advance

Vineela
arnel nicolas
Ranch Hand

Joined: Dec 16, 2003
Posts: 149
hi, i guess you posted you are in the wrong forum but try
to study the code below which might help you.



import java.util.*;
import java.text.*;

class DisplayDate{

public static void main(String[] args) {
System.out.println(new SimpleDateFormat("yyyy-mm-dd").format(new Date()));
}

}
Swamy Nathan
Ranch Hand

Joined: May 16, 2004
Posts: 187
Anothet thing whenever you start thinking up about formatting dates then u also end up trying to externalize all ur messages into resource bundles so also look up the internationalization tutorial from sun.
http://java.sun.com/docs/books/tutorial/i18n/index.html

You should start using this especially the MessageFormat class
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Question
 
Similar Threads
Head First Design Patterns Release Date
about dataBase books
Another format check :P
WA #1.....word association
How can I get sysdate in java?