The Input form as "DD-MM-YY" format but i need to type into from a string of the different format? How do i do this?

image
This is the format i need to put into form in the dd mm yy one

Hi @Arvind_Karthigayan

Try with this expression

DateTime.ParseExact(StringInput.ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd")

Regards
Gokul

image
Getting this error

Hi,

Please store the output in a string variable instead DateTime variable like below code.
This will resolve the error.

Str_Var= DateTime.ParseExact(StringInput.ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd")

Regard,
Ashutosh gupta

Can you tell us the input format ?

Regards
Gokul

@Arvind_Karthigayan

Please try this

DateTime.ParseExact(StringInput.ToString,"yyyy-MM-dd",System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd")

As per screenshot this is the input format

cheers

18-02-1998 (DD-MM-YYYY)

@Arvind_Karthigayan

DateTime.ParseExact(dateOfBirth.ToString,{“dd-MM-yyyy","yyyy-MM-dd"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString(“dd-MM-yy”)

Regards
Sudharsan

Try with this one @Arvind_Karthigayan

DateTime.ParseExact(StringInput.ToString,"yyyy-MM-dd",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yy")

Regards
Gokul

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