• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Processing & Altering Date XMLGregorianCalendar

 
om ganesh
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
 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
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