Use one of the
DateTime Structure (System)[
^] conversion methods
Parse
,
ParseExact
,
TryParse
, or
TryParseExact
to convert the string to a
DateTime
.
Use an exact method if you know that the input is always in a defined format. The format string for your date
Fri Jan 31 2014 00:00:00 GMT-0800 (Pacific Standard Time)
is (untested) "ddd MMM dd yyyy hh:mm:ss 'GMT'zzz ".
You might strip off the time zone name from the string before parsing.
The
DateTime
object can then be converted back to a string using the
ToString
with the required output format ("yyyy-MM-dd").