How could i extract the date from this string?

how could I extract the date from this string with this format?

string: 2019-12-05T17:04:16-02:00
what I want: 05122019 (ddmmyyyy)

1 Like

Fine the expression be like this

DateTime.ParseExact(Split(str_input,”T”)(0).ToString,”yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture).ToString(“ddMMyyyy”)

Cheers @Suporte4

1 Like

Hi @Suporte4

Use CDate(string).ToString(“ddmmyyyy”)

Thanks
Ashwin S

1 Like

Hi!
It’s work fine!

Thank You.

Where could I learn more about it?

We got lot of scenarios here in forum itself buddy
Cheers @Suporte4

Hi, it’s work almost well. Returns me 05042019 (correct is: 05122019)

Hi @Suporte4
Change the month format as MM

Thanks
Ashwin S

1 Like

Nice!
Ty

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