Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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


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: 1141

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
It's not a secret anymore!