P. Apiuth ArunAPIUTH EngineeringArchitecture · Engineering · Innovation

Full-stack engineering · Technical leadership

20 years of engineering. Built through delivery.

From user interfaces and APIs to SQL Server, financial-crime technology and production problem-solving.

Explore my experience
P. Apiuth Arun
P. Apiuth Arun

C# and data parsing

C# DateTime Conversion Extract Date from Unformatted String

Extracting a date from mixed text using regular expressions and explicit date parsing.

Originally published by Apiuth Arun on C# Corner on 2023-10-11. Last updated there on 2025-02-18.

Article overview

My original post demonstrates finding a date-like substring with a regular expression and then using DateTime.TryParseExact with explicit formats and invariant culture. It includes several differently formatted inputs and reports unsuccessful conversions. The key implementation choice is to align the extraction pattern with the actual input format.

Read the original

Read the full article on C# Corner