VishnuMV
(Viz)
1
Hi all,
How to convert a String value from current row in excel to date time variable.
I’m taking each row from a dt as a string variable how to convert that to date time.
Example string value: 12/12/2022 21:00:00 = string from each row excel dt.
I want this value in datetime format MM/dd/yyyy HH:00:00, the above values must be passed as date and time varaiable too.
Output value 12/12/2022 21:00:00 = datetime
Thanks in advance
ppr
(Peter)
2
on of a few options:

Along CDate other conversion options are
DateTime.Parse / ParseExact
Convert.ToDateTime
Anil_G
(Anil G)
3
@VishnuMV
Another method
Datetime.parseexact(currentrow(“datecolumn”).tostring,”MM/dd/yyyy hh:mm:ss”,system.Globalization.culturalinfo.InvariantCulture)
Cheers
system
(system)
Closed
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.