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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:22:22+00:00 2026-05-31T05:22:22+00:00

2/22/2012 3:30:00 Surely that is an acceptable format to be converted to DateTime using

  • 0

2/22/2012 3:30:00

Surely that is an acceptable format to be converted to DateTime using Convert.ToDateTime()?

  • 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-31T05:22:22+00:00Added an answer on May 31, 2026 at 5:22 am

    I would personally avoid using Convert.ToDateTime. I generally prefer1 to use DateTime.TryParseExact, specifying the culture and format string you expect – assuming you have an expected format, of course. If you don’t, you have to ask yourself bigger questions.

    For example:

    DateTime value;
    if (DateTime.TryParseExact(text, "M/d/yyyy H:mm:ss",
                               CultureInfo.InvariantCulture,
                               DateTimeStyles.None,
                               out value))
    {
        Console.WriteLine("Parsed to {0}", value);
    }
    else
    {
        Console.WriteLine("Failed to parse");
    }
    

    That’s a slightly odd format to start with – normally a 24-hour format would include a leading 0 for the hour, and a 12-hour format would include an am/pm designator.


    1 Well, I prefer to use Noda Time, but that’s a different matter…

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

Sidebar

Related Questions

Today is 24 gen 2012 for Europe. I'm using mktime to get a DateTime
How can I convert 2012-01-18T11:45:00+01:00 (ISO 8601) to 1326883500 (unixtimestamp) in PHP?
I am using Maya 2012 to create a wall made up of bricks (polyCubes).
Convert 20-JAN-2012 into 01/20/2012 . The solution should work in IE and FF latest
So now (Jan 2012) that true fixed toolbars have been implemented in jQuery Mobile
I need a circa 2012 example of how to login to UPS using PHP
We created a tag 2012/02/16 on our git repository. We then noticed that inside
how to convert this Sun Jan 08 2012 00:00:00 GMT+0530 (Sri Lanka Standard Time)
Input Date Format DD-MM-YYYY Example 15-01-2012 I have a booking date stored in Session
I want to display the dates in the format jan 1,2012 - jan 31,2012

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.