Parse custom date time format

  • Language:: CSharp
  • Type:: Back-end
  • Context:: When you have a custom or inconsistent date and or time format, this may a good way to parse the text/string
  • Snippet
 
DateTime insertedDateTime = DateTime.ParseExact(tokens[0] + " " + tokens[1], "yyyy-MM-dd mm:HH:ss", CultureInfo.InvariantCulture);
 

📇Additional Metadata