|
-
Oct 10th, 2007, 11:14 PM
#1
Thread Starter
^:^...ANGEL...^:^
[2005] Parse a DateTime value from XML file
Hi,
We are receiving XML feed from a service provider for a Match between TeamA & TeamB. In that feed among all the other stuff there is a DateTime node. Sample is below.
Code:
<NFL>
<DATE>10-08</DATE>
<WORDCOUNT>0000</WORDCOUNT>
<DATETIME>st 10-08-06 13:42 et</DATETIME>
<AWAYTEAM>WASHINGTON</AWAYTEAM>
<HOMETEAM>NYGIANTS--</HOMETEAM>
</NFL>
All nodes are processed fine but I am having problems understanding the foramt of <DateTime> node's innertext. Can someone help me out on how to parse it and what does the "st" and "et" stands for?
I need to convert the <DateTime> in Eastern Daylight Time (GMT -5, GMT -4 DST)
Any help is appreciated.
Cheers
-
Oct 10th, 2007, 11:27 PM
#2
Re: [2005] Parse a DateTime value from XML file
How as that value written in the first place? It doesn't look like a standard date/time format as far as I can tell.
-
Oct 10th, 2007, 11:35 PM
#3
Thread Starter
^:^...ANGEL...^:^
Re: [2005] Parse a DateTime value from XML file
 Originally Posted by jmcilhinney
How as that value written in the first place? It doesn't look like a standard date/time format as far as I can tell.
Yeah that is exactly what I thought too. We are getting this from ESPN (I think) and they are giving us the XML feed file, I assume the data is coming from their database.
Looking at the documentation gives me this.
The <DateTime> tag contains a timestamp indicating when the message was transmitted.
Last edited by wrack; Oct 10th, 2007 at 11:39 PM.
-
Oct 11th, 2007, 11:25 AM
#4
Re: [2005] Parse a DateTime value from XML file
In this text "st 10-08-06 13:42 et"
st stands for Standard Time (versus daylight saving time)
et stands for Eastern Time (timezone)
10-08-06 13:42 is the date and time in MM-dd-yy HH:mm format.
Just a guess though....
-
Oct 11th, 2007, 05:19 PM
#5
Thread Starter
^:^...ANGEL...^:^
Re: [2005] Parse a DateTime value from XML file
Yeah that is what I have fugured after thinking about it and that is the only thing which makes sense.
I assume when daylight savings is in order then the st would probably be replaced by dt. Again the documentation doesn't mention this at all.
Thanks for helping me with such a vague information.
-
Oct 11th, 2007, 05:59 PM
#6
Re: [2005] Parse a DateTime value from XML file
It looks to me like you're just going to have to parse the prefix and suffix yourself, with no specific help from the Framework. Someone recently posted a TimeZoneInfo class in the CodeBank which may prove useful at some point. As for the actual date/time part, the Date.Parse or .ParseExact method will do the job there.
-
Oct 11th, 2007, 08:17 PM
#7
Thread Starter
^:^...ANGEL...^:^
Re: [2005] Parse a DateTime value from XML file
Yups that is already being done. I just needed extra help with the "st" and "et".
Thanks all for your input
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|