If Date in any format like (04/04/2023 or 04.04.2023 or 04-04-2023 or 04-04-23 or 04.04.23 or 04/04/23 or April/04/2023 or 04/April/2023)
and my file name is 2023.04 if also come like this 2023-04 i need to handle
If Date in any format like (04/04/2023 or 04.04.2023 or 04-04-2023 or 04-04-23 or 04.04.23 or 04/04/23 or April/04/2023 or 04/April/2023)
and my file name is 2023.04 if also come like this 2023-04 i need to handle
You can acheive like this
DateTime.ParseExact(datestring,{"MM/dd/yyyy","MM-dd-yyyy","MM-dd-yy","MM.dd.yyyy","MM.dd.yy"},System.Globalization.CultureInfo.InvariantCulture)
You can add more formats if you need to
Hope this helps
Cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.