Unknown XMLGregorianCalendar output


I'm using the below to get the current datetime using XMLGregorianCalendar in GMT format, but I get 2010-04-07T16:44:51.000Z.  I'm unsure what the "Z" is at the end.  The rest looks correct.

 private XMLGregorianCalendar getCurrentDateTime(){
        GregorianCalendar gc = new GregorianCalendar();
        DatatypeFactory dtf=null;
        try {
            dtf = DatatypeFactory.newInstance();
        } catch (DatatypeConfigurationException ex) {
            Logger.getLogger(SyncServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
        return dtf.newXMLGregorianCalendar(gc);
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

VenabiliConnect With a Mentor Commented:
Extending XMLGregorianCalendar  and using the new class (and taking care of it there) is the only fast way I can think of.

http://www.coderanch.com/t/224752/Web-Services/java/Jaxb-display-instead-Z-timezone shows an example for it.
This Z stays for RFC 822 style timezone (-0400 for example) when SimpleDateFormat is used so I suspect it is what it stays for here as well.

Why it does not get expanded is not something I can answer without seeing some more code...
What JDK do you use?
Because there used to be a bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5064587 so if you use an oldish one, this might be the explanation...
cgray1223Author Commented:
Hi Venabili,

i'm using 1.5....can you think of any way to format it to remove it?
All Courses

From novice to tech pro — start learning today.