Parsing string dates into DateTime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Rae

    Parsing string dates into DateTime

    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


  • Chad Z. Hower aka Kudzu

    #2
    Re: Parsing string dates into DateTime

    "Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in
    news:u$vicglcFH A.2664@TK2MSFTN GP15.phx.gbl:[color=blue]
    > 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... :-)[/color]

    DateTime.Parse


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

    Make your ASP.NET applications run faster

    Comment

    • Mark Rae

      #3
      Re: Parsing string dates into DateTime

      "Chad Z. Hower aka Kudzu" <cpub@hower.org > wrote in message
      news:Xns967785F 10202cpubhowero rg@127.0.0.1...
      [color=blue]
      > DateTime.Parse[/color]

      Thanks.


      Comment

      Working...