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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:32:09+00:00 2026-06-04T02:32:09+00:00

I have created a C# WinForms application. On my computer the following works: DateTime.ParseExact(13/05/2012,

  • 0

I have created a C# WinForms application.

On my computer the following works:

DateTime.ParseExact("13/05/2012", "dd/mm/yyyy",  null)

but this doesn’t:

DateTime.Parse("13/05/2012")

On my client’s computers it’s reversed. This works:

DateTime.Parse("13/05/2012")

but this doesn’t:

DateTime.ParseExact("13/05/2012", "dd/mm/yyyy",  null)

The error states:

String was not recognized as a valid DateTime.

Didn’t manage to find any information on the internet about this problem. The program uses .Net Framework 4 and is a x86 application. I run Windows 8 x64, the client runs Windows 7 x64.

Does anybody have a clue as to why this occurs?

Thanks.

  • 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-04T02:32:10+00:00Added an answer on June 4, 2026 at 2:32 am

    The reason you are getting different behaviour on different computers is because they are running with different cultures. Try running this line of code on both computers to see if it outputs something different: (ideone)

    System.Console.WriteLine(CultureInfo.CurrentCulture);
    

    Output (example):

    en-US
    

    The culture specifies many things, one of which is the date separator. If you want consistent behaviour for all users, try specifying a culture: (ideone)

    CultureInfo cultureInfo = CultureInfo.InvariantCulture; // or whatever you prefer
    DateTime dateTime = DateTime.ParseExact("13/05/2012", "dd/MM/yyyy", cultureInfo);
    

    The above code assumes you have these using statements:

    using System;
    using System.Globalization;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a dialog box in my WinForms application. This has many text
I have a Winforms application created in Visual Studio 2005 Pro, it connects to
I have created a mac application using the WebView. But issue is that webView
I have created a SQL DB-based winforms application, and I want to deploy it
I have written and tested a WinForms application and everything works fine on my
I am using Visual Studio 2008. I have created a Winforms application, and I
This is related to Alternate Application.Run Winform In Program.cs File I have created textfile
We have created a WinForms application and store some configurations via the ConfigurationManager class.
I have created a .NET C# WinForms application on Win 7 RTM x64, which
This is getting extremely irritating. Right now I have a winforms application, and things

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.