This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Processing & Altering Date XMLGregorianCalendar  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am new to Java & am tring to use XMLGregorianCalendar
to
get a date in format of "2009-10-07T06:00:00+0530"

Right now am using new DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar(System.currentMilles()));

to get the date in this said format.

I am unaware of how to update the date value by a day or a minute .. using Duration API
eg ...
"2009-10-07T06:00:00+0530"
to
"2009-10-07T06:01:00+0530"

It would be good if any one can forward me some ReadMe on Java's Duration
 
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are already using a normal GregorianCalendar; pass the return value of its getTime() method to a DateFormat. You will probably want to use SimpleDateFormat as the concrete DateFormat class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!