Hi I want to change date format
11/04/2023 12:47PM to 20230411
Please provide solution
Hi @Kuldeep_Pandey
give a try with
DateTime.ParseExact(strInput, "dd/MM/yyyy hh:mmtt", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyyMMdd")
Regards
Thankyou Team
Hey @Kuldeep_Pandey
got your error, give a try with this new
DateTime.ParseExact(strInput, {"dd/MM/yyyy hh:mmtt", "dd/MM/yyyy h:mmtt", "d/MM/yyyy hh:mmtt", "d/M/yyyy hh:mmtt", "d/MM/yyyy h:mmtt"}, System.Globalization.CultureInfo.InvariantCulture).ToString("yyyyMMdd")
if any format is missing please add within the {} in the above code,
Regards
I am getting Output is diff Like 20231104
But in the middle i want month
Try this
Cheers,
1 Like
What Will be the variable type in this?
string type
Its not working but
did you use my code? can i see your error?
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.