Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6365609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:18:52+00:00 2026-05-25T00:18:52+00:00

I have a Tomcat server app, which creates xml responses based on classes I

  • 0

I have a Tomcat server app, which creates xml responses based on classes I populate.

One of the classes has a date field:

@XmlRootElement
public class Login {

    private String mLoginUserID;
    private String mLoginPassword;
    private Date mRecordChangeDateTime;

...

@XmlElement(name = "recordChangeDateTime")
public Date getRecordChangeDateTime() {
    return mRecordChangeDateTime;
}

The resulting XML output looks like:

<recordChangeDateTime>2011-08-02T21:03:00-04:00</recordChangeDateTime>

Couple problems I am trying to figure out…

1) Its converting the date to local timezone, the date is handled as UTC all the way throughout, but when javax.xml outputs it, it applies the timezone conversion.

2) I am trying to configure how the date is formatted. My standard format is “yyyy-MM-dd HH:mm:ss” across my client devices, and would like the xml response to use this format as well.

I having been spending many many hours researching and trying to work through this, I have attempted lots of variations of SimpleDateFormat, XMLGregorianCalendar, etc… but nothing I do changes the output in anyway… I am not sure if there is an annotation or something else that allows me to configure the date output programmatically?

Any insights would be greatly appreciated!
Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:18:53+00:00Added an answer on May 25, 2026 at 12:18 am

    This is ISO8601 format.

    You want to use XmlJavaTypeAdapter, as outlined here. This will let you specify the XmlAdapter that handles all type conversions for that element. You can provide a custom one that parses/formats dates however you’d like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At work we have many Spring apps running on one tomcat server. Some of
I have a web app on Tomcat, which handles DB connection pooling, and using
I am new to TorqueBox. I have created one RESTEasy app which is currently
I have a web service app that has an xml file with Oracle connection
I have an external Tomcat server configured to run J2EE applications on my development
I have Tomcat 6.0.24 64 bit installed on two Windows Server 2008 boxes as
i am using tomcat server and i have added a rhino engine to able
I have two web applications that are running on a single Tomcat server and
I have a Tomcat and PostgreSQL installed on a server. I'm having a connection
I have a Tomcat 6.0.24 server running. I'm using to run some JSP pages.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.