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!

Date format for XML

user8742475Sep 8 2011 — edited Sep 12 2011
I have a Date object and I want it to be in the below format before I set it into a Calendar

2009-10-09T17:00:00Z

Here's my code

Calendar cal = Calendar.getInstance();
cal.setTime(new Date());

How do I do that?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2011
Added on Sep 8 2011
8 comments
439 views