I want to copy date from one column of excel sheet and paste into another column of excel sheet. The original date is"13-Jan-21" format required format is “JAN-13”. and this change has to apply for entire column. I tried
PO_date = DateTime.ParseExact(gtdate,“dd-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM-dd”) but getting error 'Option strict On disallows implicit conversions from Date to string.
Hello, and welcome to the forum!
It seems that the type of gtdate is Date and not String. So this should be enough:
gtdate.ToString("MMM-dd")
Best,
Charbel
You can try this use change cell type of Bale Reva excel activities
Give your cell range
And give your format
Regards
Sudharsan
hi Charbel
I tried that but it doesn’t work
Hi @Kanchan_Gawande ,
Input parameter for dateTime.ParseExact is string so we have to provide datefprmat in string. As per your post we understood that the gtdate is date type. Could you try like below and let us know. Thanks.
PO_date = DateTime.ParseExact(gtdate.tostring,“dd-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM-dd”)
And also refer the below documentation which is having different methods to convert date format to desired format. Thanks.
Thanks for you @balupad14 it’s super helpful
Regards
Sudharsan
Thank you sir it is very helpful
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.