Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to generate 14 digits unique number

807601Apr 3 2008 — edited Apr 3 2008
Hi friends,

i have to generate 14 digits number in one of my application ,the number should be an unique number .

firstly i was trying to used System.currentTimeMillis(); but this gives 13 digits ,even though it does not give an unique number.

next i tried System.nanoTime() ; this method is really interesting sometime it generate 13 digits and sometime it generate 14 digits

so any suggestion or help regarding this issue to generate 14 digits unique number.


regards
Sunil
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2008
Added on Apr 3 2008
15 comments
8,392 views