DateTime.Now to Jul 31 10:20:30 PST 2012 format
DirectCast(row(0), DateTime).ToString("ddd MMM dd HH:mm:ss 'PST' yyyy")
row(0) is a string that is in the format 7/29/2012 1:25:20 PM
Keeps telling me the cast is incorrect, how can I correctly cast the string?
Awesome link for patterns for datetime.
You should be using
DateTime.Parse,DateTime.TryParse,DateTime.ParseExactorDateTime.TryParseExact.I suspect you could use
CTypeinstead ofDirectCast, but personally I’d go for the method call – it makes it clearer what you’re doing.