This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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: 1134

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,
GeeCON Prague 2014
subject: date