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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:46:31+00:00 2026-06-08T06:46:31+00:00

I am currently trying to parse a string that is obtained from an xml

  • 0

I am currently trying to parse a string that is obtained from an xml that is downloaded from the web every few minutes. The string looks like this:

Thu Jul 12 08:39:56 GMT+0100 2012

At first I just did a string.split and took out everything after the time (GMT+0100 2012) and inserted 2012 after the date.

This worked great until the date changed to:

Thu Jul 12 08:39:56 GMT+0000 2012

So I would like to dynamically pasre the GMT+ whatever as they send me that string in c#.

Any advice would be appreciated.

  • 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-08T06:46:33+00:00Added an answer on June 8, 2026 at 6:46 am

    You can use DateTime.ParseExact with a custom date and time format string:

    DateTime.ParseExact("Thu Jul 12 08:39:56 GMT+0000 2012", 
                        "ddd MMM dd hh:mm:ss 'GMT'K yyyy",
                        CultureInfo.InvariantCulture)
    

    This will throw a format exception if the string and format string do not match exactly, so you may want to use DateTime.TryParseExact that will return a false if it fails.

    Instead of DateTime you may want to use DateTimeOffset that preserved timezone information , as @Keith commented – this may be important to your application.

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

Sidebar

Related Questions

Currently I am trying to parse an xml string that I already have (no
I'am currently trying to create and application (In c#) that parse a XML file
I'm trying to parse some returned html (from http://www.google.com/movies?near=37130 )to look for currently playing
I currently have a CSV file that I parse and am trying to insert
I am trying to parse an xml document that I have created. However xml.Descendants(value)
I am currently trying to parse an HTML document to retrieve all of the
I'm currently trying to parse a document into tokens with the help of regex.
Currently trying at add ajax to a site, after much reading I discovered that
Im currently trying to downlaod a audio track from a WCF, i need some
I am currently trying to write some code that will accept some FTP details,

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.