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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:30:29+00:00 2026-05-16T08:30:29+00:00

i am using debugger following is my code when i give input for date

  • 0

i am using debugger following is my code when i give input for date dateOfBirth is=10/08/2010 (dd//mm/yy format) but the birthDate variable having value={1/10/2010 12:08:00 AM}
and string outPut have value=08/10/YY
and on taking my debugger to next step to date=Convert.ToDateTime(outPut) it throws exception “The string was not recognized as a valid DateTime. There is a unknown word starting at index 6.”
Whats wrong with all this please let me know how to convert date time format dd/mm/yyyy to date for mate for sql server 2005

following is my code

  DateTime? date = null;
    if (!string.IsNullOrEmpty(DOB.Text.Trim()))
                    {
                        string dateOfBirth = DOB.Text.Trim();
                        DateTime birthDate = DateTime.ParseExact(dateOfBirth, "dd/mm/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                        string outPut = birthDate.ToString("mm/dd/YY");
                        date = Convert.ToDateTime(outPut);
                    }
  • 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-16T08:30:30+00:00Added an answer on May 16, 2026 at 8:30 am

    From your comment I understand what you are trying to do now, Convert a ‘dd/MM/yyyy’ date to a DateTime, the following code should do it

          DateTime? date = null;
          if (!string.IsNullOrWhiteSpace(DOB.Text.Trim()))
          {
            System.Globalization.DateTimeFormatInfo dateInfo = new System.Globalization.DateTimeFormatInfo();
            dateInfo.ShortDatePattern = "dd/MM/yyyy"; 
            date = Convert.ToDateTime(DOB.Text.Trim(), dateInfo);
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To get the value of an input type element, use… May 16, 2026 at 12:22 pm
  • Editorial Team
    Editorial Team added an answer For this, I have to recommend both Dia and Microsoft… May 16, 2026 at 12:22 pm
  • Editorial Team
    Editorial Team added an answer Here's an example on how to change content of a… May 16, 2026 at 12:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm having a problem with the following code. As you can a TripDetailsController is
The following code causes a NullReferenceException tStartParameter = String.Format(tStartParameter, tTo, tSubject) tProcess = Process.Start(New
I am using the debugger to step through my code. The code file I’m
I am using the following JS function to open a pop-up window to display
In my AppController I'm loading a View with the following code. - (void) loadSettingsController
I have run into a rather weird little problem. In the following code I
I've successfully built SDL from source using bcc 5.5.1 but any SDL test application
So I decided that I was going to give Ruby (first 1.9.1, then 1.8.7)
So I'm trying to make use of a GtkSourceView in C++ using GtkSourceViewmm ,
A little up front info: I have a SOAP service (hosted using JAX-WS (Endpoint

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.