aspose file tools*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "date" Watch "date" New topic
Author

date

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.
thanks!
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Jackie,
Any of the following will get you the current date:
new java.util.Date()
new java.util.GregorianCalendar()
java.util.Calendar.getInstance()
To convert the date to a formatted string, use:
java.text.SimpleDateFormat
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,
Avi.
 
 
subject: date