-5

I need to convert a string to DateTime, my string is:

string = "20220510"; and I need to convert to MM/DD/YYYY

mxmissile
  • 10,827
  • 3
  • 50
  • 78
  • There are two questions being asked here. 1) "How to parse a string as a DateTime object?" 2) "How to render the DateTime object back to a string in a different format?" I'll give you a link to solve the first problem. Please clarify your question if that is not correct. – gunr2171 May 10 '22 at 17:29
  • Also your string is ambiguous. 05 is the month or the day? and 10 is the month or the day? – Steve May 10 '22 at 17:30

0 Answers0