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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:56:42+00:00 2026-06-15T12:56:42+00:00

I have some data coming from an XML document, such as 2012-12-06T24:00. The problem

  • 0

I have some data coming from an XML document, such as 2012-12-06T24:00.

The problem is when I try to convert it : 24:00 doesnt exist. So :

DateTime.Parse(myDateTimeString).Hour

give to me this Exception: System.FormatException: The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.

How can I fix it?

The solution I think about is to replace (string) T24 with T00, which looks horrible…

  • 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-06-15T12:56:43+00:00Added an answer on June 15, 2026 at 12:56 pm

    DateTime cannot handle this. You have to “sanitize” your string before calling Parse and handle the overflow (depending on what “24:00” actually means):

    DateTime date = DateTime.Parse(myDateTimeString.Replace("T24:00", "T00:00"));
    
    if (myDateTimeString.Contains("T24:00"))
    {
        date = date.AddDays(1);
    }
    

    EDIT: added the “overflow”-part.

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

Sidebar

Related Questions

I'm trying to convert some XML data coming from a CLOB to a XMLType
I have a function that will parse some data coming in. My problem is
I want to display some data relations (coming from an xml, for that matter)
basically i have parsed some data from XML into a NSMutableArray that is shared
I have a ListBox populated with data coming from XML. Fine so far, the
I have some data coming from the hardware. Data comes in blocks of 32
I have some decimal data coming from an external service. I need to format
I have some data coming from server in form of string. The string might
I have some data coming from the server in which I fill A Div
I have some data loaded as a np.ndarray and need to convert it to

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.