VBA Issues converting string to date using format() or CDate()
问题 If this has been asked before, please point me in the right direction. I can't seem to find anything useful with my google-ing skills. I have the following code, which reads in a string like this; Outage StartDate: 05/10/11 23:59 EST And pulls out the date information, i.e. 05/10/11 23:59 sStartTime = Mid(objItem.Body, 18, 15) ' Extract the start time Debug.Print "sStartTime after reading: " & sStartTime sStartTime = Format(sStartTime, "dd/mm/yy hh:mm") ' Format date correctly Debug.Print