I have been having problems working with dates. I need to have a DateTime instance that has the "dd-MM-yyyy" format. I'm NOT asking to have a string of my date instance in the "dd-MM-yyyy", that I know. I need to seed my date obj through the Entity framework, that calls a StoreProc that receives a param that it a Date... I can always change my SP to receive a Varchar instead of Date, but I want type safety.
The following code can help you to understand the problem:
Dim s1 As String = CurrentUICulture.ToString() 'pt-PT
Dim s2 As String = CurrentCulture.ToString()'pt-PT
Dim odate As Date = DateTime.ParseExact(sdate, CurrentUICulture.DateTimeFormat.ShortDatePattern, CurrentUICulture) 'sdate = 19/03/2009
'CurrentUICulture = pt-PT - ShortDatePattern = "dd-MM-yyyy"
'odate is 03/19/2009 !!!
Convert.ToDateTime(sdate, CurrentUICulture)
'its the same!
HELP!