Help for convert String to Date

Hi to all,
I collected with a scraping, this date, as a String.
I should convert it to Datetime to upload it to the Database.
image

In the table, seconds are missing, so I would like to set all seconds = 00

ex: 2022-05-15 9:47:00

Can help me with this? :expressionless:

Thanks
Aaron

@AaronMark

Check below for your reference

Hope this may help you

Thanks

Hello,

You can try this:
DateTime.ParseExact(“12/05/2019 9.20”,“dd/MM/yyyy h.mm”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd-MM-yyyy hh:mm:ss”)

Thanks!
Athira

Thanks Athira.
I had to tweak the string a little, but the hint was very helpful.

DateTime.ParseExact(Data_Firma_PDA,“dd/MM/yyyy H.mm”,System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd HH:mm:ss”)

1 Like

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