• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Processing & Altering Date XMLGregorianCalendar

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic