I have the following problem:
I want to convert a value of CurrentRow from type String to type DateTime. Using the expression Convert.ToDateTime(CurrentRow(0).ToString), the format looks like this: “07/08/2023 00:00:00” (for the date August 7th, 2023).
I want to write this DateTime value to a datatable, but without the 00:00:00 time information. So far, I have only been able to find options that convert the value back to a string to allow a split at the space. For my case the date must remain in DateTime format.
you may try this -
DateTime.ParseExact(CurrentRow(0).ToString,“dd/MM/yyyy HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)
first of all thank you for the quick answers!
I have tested all options but still face the same problem. The date comes out in the correct format (like 07/08/2023 without the time), but the final datatype in each option is still a string and not a datetime… or am I doing somehting wrong?