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. Advertisements

  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. Advertisements

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. luna
    Replies:
    1
    Views:
    7,060
  2. Brian Candy
    Replies:
    2
    Views:
    1,470
    Janaka
    Feb 18, 2004
  3. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    1,049
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  4. mp
    Replies:
    1
    Views:
    680
    John Machin
    Jul 28, 2006
  5. Martin
    Replies:
    0
    Views:
    646
    Martin
    Dec 27, 2008
  6. Replies:
    2
    Views:
    1,063
    M.-A. Lemburg
    Jan 6, 2009
  7. NiklasRTZ

    datetime.datetime. or datetime. ?

    NiklasRTZ, Oct 8, 2009, in forum: Python
    Replies:
    10
    Views:
    761
    niklasr
    Oct 11, 2009
  8. Fei Liu
    Replies:
    21
    Views:
    3,230
    John Bokma
    Dec 16, 2006
Loading...