This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Question

 
Vineela Devi
Ranch Hand
Posts: 191
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic