How to convert this Date formate 26-Dec-2021 to this formate 26/12/2021

Suggest the Correct expresion to make a conversion

Hi @Gopi_Krishna1
try out this syntax

YourDateVariable.ToString(“dd/MM/yyyy”)

Thanks,
Robin

Hi @Gopi_Krishna1,

Just wrote a rough code on editor try this, will give you what you require I think
Datetime.parseexact(“26-Dec-2021”,“dd-MMM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).tostring(“dd/MM/yyyy”)

Thanks,
Shikhar

I am getting this date as string formate…Can i able to convert it

Hey,
solution:
Datetime.ParseExact(strVar,“dd-MMM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)
image

I am getting this date as string formate…Can i able to convert it

yes you can

String was not recognized as valide date time like this coming

OK, just show the error, also try printing in a message box and check if the date format is what you mentioned or it contains some trailing zero’s as well.

yes ,we can able to convert a date format by using string only

Try this :slight_smile:

Datetime.ParseExact(“26-Dec-2021”,“dd-MMM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Variable name date contains this 26-Dec_2021 value can I use this varible in this expression

as of my understanding Unformate is datetime variable right?

If it is so . double put double quotes
simply use
Unformate = 28-Dec-2021

Hey,
here is example - how to do it :slight_smile:
BlankProcess46.zip (2.2 KB)

Yes

Datetime.ParseExact(VariableHere,“dd-MMM-yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

thanks,
Shikhar

Hi!

Try like this!

Date1

Regards,
NaNi

Thanks getting my expected Output

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.