string 2 date conversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Wu

    #1

    string 2 date conversion

    I have a string looked this
    "2003-07-08T13:04:00.000 0000"

    How do I convert it into a System.DateTime object?



    Regards



    Michael


  • Ignacio Machin

    #2
    Re: string 2 date conversion

    Hi Michael,

    You can use DateTime.Parse or DateTime.ParseE xact , the different is that
    the latter expect that the string being on a especified format.

    Hope this help,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation

    "Michael Wu" <do_not_reply_t o_this_account@ my.com> wrote in message
    news:OkLk0gwSDH A.1912@TK2MSFTN GP12.phx.gbl...[color=blue]
    > I have a string looked this
    > "2003-07-08T13:04:00.000 0000"
    >
    > How do I convert it into a System.DateTime object?
    >
    >
    >
    > Regards
    >
    >
    >
    > Michael
    >
    >[/color]


    Comment

    • Greg Ewing [MVP]

      #3
      Re: string 2 date conversion

      Michael, check out the DateTime.Parse( ) method.

      --
      Greg Ewing [MVP]



      "Michael Wu" <do_not_reply_t o_this_account@ my.com> wrote in message
      news:OkLk0gwSDH A.1912@TK2MSFTN GP12.phx.gbl...[color=blue]
      > I have a string looked this
      > "2003-07-08T13:04:00.000 0000"
      >
      > How do I convert it into a System.DateTime object?
      >
      >
      >
      > Regards
      >
      >
      >
      > Michael
      >
      >[/color]


      Comment

      Working...