Hi,
Trying to convert a Date from mm/dd/yyyy to dd/mm/yyyy using
Howver VB is throwing the following error
Conversion from string "01/27/2010" to type 'Date' is not valid
Any ideas why?
Thanks
Trying to convert a Date from mm/dd/yyyy to dd/mm/yyyy using
Code:
Public Function USToUKDate(ByRef USDate As String) As Date
Dim Newdate() As String = USDate.Split("/")
'Converts from US date format "01/20/2001" to UK 01/02/2013'
Dim UKDate As String = Newdate(1) & "/" & Newdate(0) & "/" & Newdate(2)
USToUKDate = CDate(UKDate)
Quote:
Conversion from string "01/27/2010" to type 'Date' is not valid
Thanks