79416154

Date: 2025-02-05 20:49:44
Score: 3
Natty:
Report link

The default dateformat of en-US is mm/dd/yyyy, this is why the conversion fails.

If your string-date is always formatted as dd/mm/yyyy hh:mm:ss you should use DateTime.ParseExact as shared on this StackOverflow-post:

How to Convert a Date String with Format "dd/MM/yyyy" to OS Current Culture Date Format

Reasons:
  • Blacklisted phrase (1): StackOverflow
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: lordofcode