DateTimeFormat

Hie there i have a date in thai language like
( 25-มีนาคม-1999) and i want to convert it into that will give me the output as (dd-MM-yyyy)

I want result output in (25-03-1999)

Thanks in advance…

Hi,

Can you try the following expression?

DateTime.Parse(yourString,System.Globalization.CultureInfo.CreateSpecificCulture("th-TH")).ToString("dd-MM-")+System.Text.RegularExpressions.Regex.Match(yourString,"\d+$").Value

Regards,

1 Like

HI @singh_sumit

Here’s the expression:

DateTime.ParseExact(“25-มีนาคม-1999”,“dd-MMMM-yyyy”,System.Globalization.CultureInfo.CreateSpecificCulture(“th”)).ToString(“dd-MM-”)+ Split(“25-มีนาคม-1999”,“-”)(2).ToString

Unable to extract the year directly using DateTime Parser, would have to append the year separately.

Thanks,
Aditya

Thanks alot Mr. Yoichi thanks for the help

1 Like

Thanks alot @adiijaiin

1 Like

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