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 67497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:16:09+00:00 2026-05-10T19:16:09+00:00

I have this in some WSDL: <element name="startDate" type="xsd:dateTime"/> <element name="endDate" type="xsd:dateTime"/> Which results

  • 0

I have this in some WSDL:

<element name="startDate" type="xsd:dateTime"/> <element name="endDate" type="xsd:dateTime"/> 

Which results in the following text in the SOAP envelope:

<startDate>2008-10-29T12:01:05</startDate> <endDate>2008-10-29T12:38:59.65625-04:00</endDate> 

Only some times have the milliseconds and zone offset. This causes me a headache because I’m trying to get a range of 37 minutes and 54 seconds in this example, but because of the offset I end up with 4 hours, 37 minutes, 54.65625 seconds. Is this some kind of rounding error in DateTime? How do I prevent this from happening?

  • 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. 2026-05-10T19:16:10+00:00Added an answer on May 10, 2026 at 7:16 pm

    I suspect your endDate value has the Kind property set to DateTimeKind.Local.

    You can change this to DateTimeKind.Unspecified as follows:

    endDate = DateTime.SpecifyKind(endDate, DateTimeKind.Unspecified) 

    after which I believe it will be serialized without the timezone offset.

    Note that you will get a DateTime with DateTimeKind.Local if you have initialized it using DateTime.Now or DateTime.Today, and DateTimeKind.Utc if you have initialized it using Datetime.UtcNow.

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

Sidebar

Related Questions

We have a WSDL which contains the following type definition: ... <xsd:complexType name=OrderItem> <xsd:all>
I want to have URLs like this: some-company-name-deal-id-6.htm So the rewrite rule should ignore
I have a WSDL which I need to trigger some commands from. I need
I have some WSDL from which I need to generate a web service implementation.
Let's say I have a ClassA which contains some members of type String and
I have some common types which are defined in an xsd file which is
I have this: $text = 'This is some text /*Comment 1 */ . Some
suppose I have this string: some striinnngggg <a href=something/some_number>linkk</a> soooo <a href=someotherthing/not_number>asdfsadf</a> I want
i have this code: def some_method(): #i need to get some attrs :( return
I have this game with some variety of textures. Whenever I draw a texture

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.