Skip to Main Content

Java Programming

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 date of 9999-12-31 23:59:59:999999

807605Oct 11 2007 — edited Oct 11 2007
Hi

It is required to generate date of *"9999-12-31 23:59:59:999999"* Using the following code, I could generate 9999-12-31 23:59:59:000156

Calendar c = new GregorianCalendar();
c.set(9999, 11, 31, 23, 59, 59);
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSSSSS");
System.out.println(s.format(c.getTime()));

Any help is highly appreciated

Thank you
Moni
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2007
Added on Oct 11 2007
2 comments
3,634 views