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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:34:44+00:00 2026-05-17T19:34:44+00:00

I need to parse string to DateTime. The string is always in the following

  • 0

I need to parse string to DateTime. The string is always in the following format

“10.10.2010” That means dd.MM.yyyy, separated with dots.

I want to use DateTime.TryParse or any other method. Please suggest.

UPDATE

Updated the question. I am just looking for the right method to achieve the goal.
Not manual parsing

  • 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-17T19:34:45+00:00Added an answer on May 17, 2026 at 7:34 pm

    TryParse doesn’t let you specify the format – but you can use TryParseExact:

    DateTime date;
    if (DateTime.TryParseExact(text, "dd'.'MM'.'yyyy",
                               CultureInfo.InvariantCulture,
                               DateTimeStyles.None,
                               out date))
    {
       // Success
    }
    else
    {
       // Parse failed
    }
    

    Note that the dot doesn’t strictly need to be escaped with the quotes, but personally I like to put any literal text in quotes just to make sure that it won’t be changed. It’s a personal preference thing though – you could certainly just use “dd.MM.yyyy” if you wanted.

    Likewise I’ve specified the invariant culture which is what I normally do for a fixed custom style – but you could make it use the current culture or a specific other culture if you wanted. When you’re using a custom style (rather than a standard style such as “long date”) it’s less likely to make any difference, admittedly.

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

Sidebar

Related Questions

I need to parse out the string that has following structure x:{a,b,c,}, y:{d,e,f} etc.
I need to parse following String into a DateTime Object: 30/Nov/2009:16:29:30 +0100 Is there
I need to parse a XML String so I can use some of the
I need to parse string that looks like in example below: Regex TitleRegex =
I need to parse DateTime string coming from AppEngine in Java (Android). The string
The string I want to format looks like this: String datetime = 9/1/10 11:34:35
I need to parse a Python-generated datetime string into a Javascript Date object. I
I have a string like this: 2010-01-01 12:30:00 I need that to convert to
What I need is to use string variables to build DateTime based on the
I need to parse string from datapicker to a DataTime object and save in

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.