Parsing string dates into DateTime

  • Thread starter Thread starter Mark Rae
  • Start date Start date
M

Mark Rae

Hi,

Say you are working with a CSV file generated by a legacy mainframe which
stores dates in the format 'ddMMMyy' e.g. ,16JUN05,

Extracting the individual date parts is easy enough, but is there a "neat"
way of converting the string 'JUN' into the integer 6. Obviously it would be
easy enough to write a function for this, but is there a simpler way, say,
with int.Parse or something similar.

Just curious... :-)

Mark
 
Mark Rae said:
Say you are working with a CSV file generated by a legacy mainframe
which stores dates in the format 'ddMMMyy' e.g. ,16JUN05,

Extracting the individual date parts is easy enough, but is there a
"neat" way of converting the string 'JUN' into the integer 6.
Obviously it would be easy enough to write a function for this, but is
there a simpler way, say, with int.Parse or something similar.

Just curious... :-)

DateTime.Parse


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
 
Back
Top