Convert date string into date object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony B

    #1

    Convert date string into date object

    I'm looking to convert a string in "dd/MM/yy" format into a date object. How
    do I go about this ?


  • Armin Zingler

    #2
    Re: Convert date string into date object

    "Tony B" <tonyb@imagepro c.comschrieb
    I'm looking to convert a string in "dd/MM/yy" format into a date
    object. How do I go about this ?
    A look in the docs reveals:
    http://msdn2.microsoft.com/en-us/library/b4w53z0y.aspx


    Armin

    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Convert date string into date object

      Tony,

      As you are in the part of the world where an European language is spoken not
      Russian or Swedish and not in the USA, then you can simple try the very
      simple optimized .Net command

      \\\
      dim myDate = CDate(31/12/2008)
      ///

      for older versions than 2008

      dim mydate as DateTime = CDate(31/12/2008)

      Cor

      Comment

      • rowe_newsgroups

        #4
        Re: Convert date string into date object

        On Apr 7, 8:53 am, "Tony B" <to...@imagepro c.comwrote:
        I'm looking to convert a string in "dd/MM/yy" format into a date object. How
        do I go about this ?
        Intellisense is your friend.

        You mention you want to Parse a string into a DateTime, so how about:

        DateTime.Parse( ...)

        Thanks,

        Seth Rowe [MVP]

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Convert date string into date object

          "Tony B" <tonyb@imagepro c.comschrieb:
          I'm looking to convert a string in "dd/MM/yy" format into a date object.
          How do I go about this ?
          'DateTime.Parse Exact' + format string, if the date is always in the same
          format regardless of the system's date/time format settings.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          Working...