1
  1. This line is parsed DateTime.Parse("08/08/2000 00:00:00")

  2. This line isn't parsed DateTime.Parse("08/24/2000 00:00:00")

Question is very simple and stupid, I'm sorry but can't figure out why.

Richard
  • 149
  • 1
  • 1
  • 5

1 Answers1

1

This is likely a localization issue, where it's trying to parse in day/month/year format, and you're assuming it's month/day/year format.

oppassum
  • 1,746
  • 13
  • 22
  • I tried following format: DateTime.Parse("24/08/2000 00:00:00") and got an error instantly that format is wrong. It's so weird – Richard Aug 30 '22 at 16:53
  • @Richard It's not weird, you just need to Google better. In UK we use `dd-mm-yyyy` but in USA it is `mm-dd-yyyy`. There are literally hundreds, if not thousands of questions with the same problem on here. – DavidG Aug 30 '22 at 16:54
  • 1
    @DavidG what format should I use to make in wordlwide-friendly? – Richard Aug 30 '22 at 17:29
  • 1
    There is no worldwide friendly, everywhere does it differently. – DavidG Aug 30 '22 at 17:34