How to format this date?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I have an ASP.Net Repeater where I display a date from a date field:
<%# DataBinder.Eval(Container.DataItem, "pubDate", "{0:f}") %>

When the dataset is created from a database the date text format change when Thread.CurrentThread.CurrentCulture change.

However, when I create the dataset from a XML (RSS 2.0 Format) file the date is allways the entire text taken from the <pubdate> node.

I believe I need to convert the pubDate field in my dataset to a convenient date format.

Here is my code which create the dataset from the XML (RSS 2.0 Format) file:

Dim news As New XmlDocument()
news.Load("http://www.domain.com/_rss/news.rss";)
Dim x As Integer
Dim xNodeList As XmlNodeList = news.SelectNodes("/rss[@version='2.0']/channel/item")
Dim dsNews As DataSet = New DataSet()
Dim xReader As XmlTextReader
For x = 0 To xNodeList.Count-1
xReader = New XmlTextReader(xNodeList.item(x).OuterXml, XmlNodeType.Element, new XmlParserContext(Nothing, Nothing, Nothing, XmlSpace.None))
dsNews.ReadXml(xReader, XmlReadMode.InferSchema)
Next x


An example of a XML (RSS 2.0 Format) file:

<?xml version="1.0"?>
<rss version="2.0">
 <channel>
   <title>News</title>
   <description>Latest News</description>
   <item>
     <title>Title</title>
     <link>Url</link>
     <description>Description</description>
     <pubDate>Fri, 20 May 2005 12:30:00 GMT</pubDate>
   </item>
   ...

Can someone help me out?

Thanks,
Miguel

.



Relevant Pages

  • Re: Setting field properties in code
    ... format that the user has defined in the Windows Control Panel, ... >> Sub StandardProperties(strTableName As String) ... >> Dim tdf As DAO.TableDef 'Table nominated in argument. ... >> Dim ind As DAO.Index ...
    (comp.databases.ms-access)
  • Re: Conditional format problem
    ... an Excel 5.0/95 format file, ... Anyone know how to save in a later Excel format from Access? ... Dim oXL As Object ... Dim strCondition1 As String ...
    (microsoft.public.excel.programming)
  • Re: Mail Merge HTML Format Word 2002 XP SP3
    ... HTML format as you have no control over how the recipient reads them. ... 'Creates a new e-mail item and modifies its properties. ... Dim olApp As Outlook.Application ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Generating a column based on import file name
    ... is d/m/yy as opposed to the format shown. ... Dim lReturn As Long ... .TextFilePlatform = xlWindows ... importing. ...
    (microsoft.public.excel.programming)
  • Re: tab in userform locks program
    ... > I am a VBA newbie and have not been using DIM in my code so it is ... declare a variable at the top of a standard module using Private (module ... You may notice that I used Format$ instead of Format. ... but Format$ returns a String whereas ...
    (microsoft.public.excel.programming)