Issues converting to DateTime format

Discussion in 'ASP .Net' started by mazdotnet, Jun 1, 2007.

  1. mazdotnet

    mazdotnet Guest

    Hi,

    I'm having a hard time parsing the following date/time that I get in
    an XML call to a third party service provider.

    12 Jun 2007 08:00 EST5EDT

    I like to assign it to DateTime and can't find anything on Google

    Thank you
    Maz
     
    mazdotnet, Jun 1, 2007
    #1
    1. Advertising

  2. mazdotnet

    Dunc Guest

    Off the top of my head (so excuse syntax errors and format string
    specifics, etc), can't you just use ParseExact:

    string myDate = "12 Jun 2007 08:00 EST5EDT";
    DateTime dt = DateTime.ParseExact(myDate, "{dd MMM yyyy hh:mm}");

    Dunc
    http://www.fluideating.co.uk

    On 1 Jun, 17:02, mazdotnet <> wrote:
    > Hi,
    >
    > I'm having a hard time parsing the following date/time that I get in
    > an XML call to a third party service provider.
    >
    > 12 Jun 2007 08:00 EST5EDT
    >
    > I like to assign it to DateTime and can't find anything on Google
    >
    > Thank you
    > Maz
     
    Dunc, Jun 1, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    758
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    596
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    439
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    375
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    801
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page