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 Formatting SSN...and time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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
It's not a secret anymore!