Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Issues converting to DateTime format

Reply
Thread Tools

Issues converting to DateTime format

 
 
mazdotnet
Guest
Posts: n/a
 
      06-01-2007
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

 
Reply With Quote
 
 
 
 
Dunc
Guest
Posts: n/a
 
      06-01-2007
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 <(E-Mail Removed)> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [2.4.4] creating a datetime.datetime from an XML xs:dateTime skip@pobox.com Python 2 01-06-2009 01:31 PM
[2.4.4] creating a datetime.datetime from an XML xs:dateTime Martin Python 0 12-27-2008 08:08 PM
mx.DateTime to datetime.datetime mp Python 1 07-28-2006 10:57 PM
datetime: .datetime-.datetime = .timedelta, .time-.time=TypeError ? Christos TZOTZIOY Georgiou Python 3 09-13-2003 10:44 AM
RE: datetime: .datetime-.datetime = .timedelta, .time-.time=TypeError ? Tim Peters Python 0 09-09-2003 12:57 AM



Advertisments