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

  • Home
  • SEARCH
  • 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 6014027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:37:57+00:00 2026-05-23T02:37:57+00:00

Scenario The date format which is output as a response to the Web Service

  • 0

Scenario

The date format which is output as a response to the Web Service client by Axis2 is formatted as “2009-08-28+01:00”. I would like to change this to show only the date without the timezone information (e.g.:”2009-08-28″)

Configuration

Libraries

Axis 2 1.4.1

WSDL

<xsd:element name="StartDate" type="xsd:date" />;

Question

  • Is it possible to change the output format, which is used by Axis 2 to write date information?
  • Can you see any issues for .NET clients reagrding the conversion of this date format?

Constraints

Unfortunately it is not possible to change the “StartDate” element to a xsd:string or xsd:token

Question refinement

As I am using the xsd:date XML Data Type which is defined as

[-]CCYY-MM-DD[Z|(+|-)hh:mm]

Thus if I set

Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("UTC");
...

then the output looks like this

2009-01-28Z

You can replace “UTC” by “GMT” or “”.

Can I get rid of the “Z”?

  • 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-23T02:37:57+00:00Added an answer on May 23, 2026 at 2:37 am

    The problem is caused by using Calendar object as a source value for xsd:date field. When you get instance of Calendar it always goes with timezone (default timezone is used if not specified explicitly). To remove timezone use clear() method and restore all fields excluding timezone. Then XML mapping library (I tested with XmlBeans, but I think it’s also true for other binding libraries supported by Axis) generates XML without timezone suffix.

    Calendar myDate = Calendar.getInstance();   // returns GregorianCalendar
    Calendar now = (Calendar)myDate.clone();    // save current timestamp
    myDate.clear(); // this clears the fields, including Calendar.ZONE_OFFSET
    myDate.set(     //set all fields back from the saved copy
        now.get(Calendar.YEAR),
        now.get(Calendar.MONTH),
        now.get(Calendar.DAY_OF_MONTH),
        now.get(Calendar.HOUR_OF_DAY),
        now.get(Calendar.MINUTE),
        now.get(Calendar.SECOND)
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a problem with date manipulation.This is my scenario.I have a daily generating
Scenario: A stored procedure receives from code a DateTime with, let's say DateTime.Now value,
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable
Scenario is that we send out thousands of emails through SMTP server. Content is
Scenario: An event is raised in class A that needs to be handled by
Scenario I have two wrappers around Microsoft Office, one for 2003 and one for
Scenario: Let's say I have four very similar applications (i.e. most of the functionality
Scenario You've got several bug reports all showing the same problem. They're all cryptic

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.