Reputation: 25197
I have a string of "DD/MM/YYYY HH:MM:SS" which I need to transform to a date, the problem is the default conversion goes "MM/DD/YYYY HH:MM:SS" unless the day is >12 in which case it switches. I'd like to ensure that my day's go into the day portion of the date/time.
Is there an easy fix to this?
Upvotes: 0
Views: 13765
Reputation: 25346
' Parse a date in ISO 8601 "universal combined" format: YYYY-MM-DDTHH:MM:SSZ
' This function ALSO accepts SQL date format: YYYY-MM-DD HH:MM:SS
Function CDateFromUniversal( s )
CDateFromUniversal = CDate(Mid(s, 1, 10) & " " & Mid(s, 12, 8))
End Function
Upvotes: 1