This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Formatting SSN...and time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formatting SSN...and time" Watch "Formatting SSN...and time" New topic

Formatting SSN...and time

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have some questions about formatting in java...
How do I format a social security number in java?
How do I format time in the hh:mm:ss format?
Thanks in advance!

Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Kerri,
I don't know about ss# but for date/time use the following:
SimpleDateFormat sdf = new SimpleDateFormat( "hh:mm:ss" );
It can be found in java.text.* package.
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Formatting SSN where? Where are you wanting to put it? Or are you talking about data entry on a screen?
I agree. Here's the link:
subject: Formatting SSN...and time
jQuery in Action, 3rd edition