File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "date" Watch "date" New topic


Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
how i can get a string
very simple string for the current date?
I just want "31/12/2002"
that's it.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Any of the following will get you the current date:
new java.util.Date()
new java.util.GregorianCalendar()
To convert the date to a formatted string, use:
For me, the class documentation ("javadoc") was sufficient for me to understand how to use the above-mentioned classes.
Hope this has helped you.
Good Luck,
I agree. Here's the link:
subject: date