Convert string date intro datetime

Hello!

How can i convert this string “Jun 2022” DE-de culture to this format “2022-06-01”.

Thank you!

Hi @Andrei_Croitoru

CDate("Jun 2022").ToString("yyyy-MM-dd")

image

Regards
Gokul

1 Like

Hey!

Try this

str_datetime = Datetime.ParseExact(Strinput.ToString, "MMM yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd", New CultureInfo(“de-DE”))

Regards,
NaNi

for Oktober we can see directly the result as the local name is different from default Oct


vs
grafik

for getting controlled the first of month we can add the day info 01 to string and using it for the parsing

1 Like

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