DateTime conversion

I Want to convert this “05SEP” String into “dd-MM-yyyy” format that is 05-09-2021(Current year) how to do it??? Help me

@Gopi_Krishna1

Try this.

  CDate("05SEP").ToString("dd-MM-yyyy")

grafik
grafik

CDate("05SEP"&"2021").toString("dd-MM-yyyy")
CDate(YourStringVar & "2021").toString("dd-MM-yyyy")

kindly note:
grafik
will return not the mentioned one date 5th sep 2021

I am having this “05SEP” string value in a variable shall use variable in this expression

@Gopi_Krishna1

Use solution provided by @ppr

We need to append the year with date.

I want to dynamic year, If next year comes means I would mention 2022, is their any expression to mention the currrent year

grafik

@Gopi_Krishna1

Try below expression.
CDate(“05SEP”&Now.Year.ToString).ToString(“dd-MM-yyyy”)

just end the word year with the r in your code

Screenshot 2021-10-18 161907

what modification I have to do it in this expression

@Gopi_Krishna1

It should be like this.

  CDate(Extracted_Estimated_Date&Now.Year.ToString).ToString("dd-MM-yyyy")

Here, Extracted_Estimated_Date variable of type String and it holds the Date and Month.

Showing error, ‘(’ expected showing like this

@Gopi_Krishna1

Put dot . after year. It should be like this Now.Year.ToString

CDate(Extracted_Estimated_Date&Now.Year.ToString).ToString(“dd-MM-yyyy”)
Like this only I have mentioned


What is the exact modification that I have to do shown by notification Please do explain it bro

Thanks Bro Have Got the Expected Output