DateTime And ParseExact Problems
Posted
by WizardsSleeve
on Stack Overflow
See other posts from Stack Overflow
or by WizardsSleeve
Published on 2010-06-08T09:21:38Z
Indexed on
2010/06/08
9:32 UTC
Read the original article
Hit count: 229
vb.net
Hi There I wish to convert my string in format dd/mm/yyyy hh:mm:ss to a DateTime of the same format.
Dim ukCulture As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-GB")
Dim myDateTime As DateTime
myDateTime = DateTime.ParseExact("18/05/2010 23:42:10, "dd/MM/yyyy HH:mm:ss", ukCulture)
When I step through this code the variable myDateTime is 05/18/2010 23:42:10 it appears that the dd/mm is the wrong way around and I cant work out how to correct this. Can ayone offer any guidance on how to correct this please?
© Stack Overflow or respective owner