Helo all, I'm confused with this two function. As I googled from most fourms, what i get is:
DateTime.Parse (or CDate) is useful to convert a string to a DateTime based
on the current regional settings in Control Panel.
DateTime.ParseExact is useful to convert a string to a DateTime based on a
specific format or a specific region/culture.
But, how it's functionality work different? What I means is as I will get "string cant convert to datetime" error but for datetime. But, sometimes it work fine.
As in my case I use datetimepicker to exact the date, likes say :
Dim strStartDate as string = Me.dtp1.Text & " " & "Me.ComboHours.SelectedItems & " : " & Me.ComboMin.SelectedItems & " : " & " 00 "
Dim dtStartDate as datetime = CDate(strStartDate)
Can anybody point this out? Thanks in advance.
DateTime.Parse (or CDate) is useful to convert a string to a DateTime based
on the current regional settings in Control Panel.
DateTime.ParseExact is useful to convert a string to a DateTime based on a
specific format or a specific region/culture.
But, how it's functionality work different? What I means is as I will get "string cant convert to datetime" error but for datetime. But, sometimes it work fine.
As in my case I use datetimepicker to exact the date, likes say :
Dim strStartDate as string = Me.dtp1.Text & " " & "Me.ComboHours.SelectedItems & " : " & Me.ComboMin.SelectedItems & " : " & " 00 "
Dim dtStartDate as datetime = CDate(strStartDate)
Can anybody point this out? Thanks in advance.