A
AVL
Hi,
I've need some info regarding datetime conversions..
I've a string in the below format'"dd/mm/yyyy"..I want it to be converted to
Datetime object with the date format as "mm/dd/yyyy"
I've used the below code..
Dim provider As IFormatProvider
provider = New System.Globalization.CultureInfo("en-US", True)
drnewRow("Inv_Date_Detail") = DateTime.ParseExact("21/11/2007",
"dd/MM/yyyy", provider).ToShortDateString()
This workds fine if my current culture in regional settings is "en-US"..
but fails when I move my current culture to 'en-GB"..
I want a generic solution to this..
how shud i convert a "dd/mm/yyyy" to "mm/dd/yyyy" in vb/net?
I've need some info regarding datetime conversions..
I've a string in the below format'"dd/mm/yyyy"..I want it to be converted to
Datetime object with the date format as "mm/dd/yyyy"
I've used the below code..
Dim provider As IFormatProvider
provider = New System.Globalization.CultureInfo("en-US", True)
drnewRow("Inv_Date_Detail") = DateTime.ParseExact("21/11/2007",
"dd/MM/yyyy", provider).ToShortDateString()
This workds fine if my current culture in regional settings is "en-US"..
but fails when I move my current culture to 'en-GB"..
I want a generic solution to this..
how shud i convert a "dd/mm/yyyy" to "mm/dd/yyyy" in vb/net?