# Datediff Problem

T

#### Tim::.

I am having some difficulties with the function Datediff! I am trying to calculate the number of days between two given date

E.G: Number days between 03-05-2004 and 05-05-2004 =

I am using the following piece of asp to extract dates from an XML document and work with them to create the above mentioned result, however I can't get it to work

Thank

...::XML Exampl

...:: AS
<
set xml = Server.CreateObject("Microsoft.XMLDOM"
xml.async = fals

set xsl = Server.CreateObject("Microsoft.XMLDOM"
xsl.async = fals

'Finds Start date in all Tasks in xml documen
Dim sNodes(200,100
Dim sDate(200,100
Dim sTime(200,100
Dim sMonth(200,100
Dim sDay(200,100
Dim fdw(200,100

node=-
var=-

for each oNode in oNode
node=node+
for i=0 to 9
sNodes(node,i) = oNode.tex
nex

' Write whole data and time for Start of task as seen in XML Documen

'Break up date into different variable
var=var+
for i=0 to 9
sTemp = sNodes( node,0
sDate( var,i ) = Mid( sTemp, 1, 10
sTime( var,i ) = Mid( sTemp, 13, 4
sMonth( var,i ) = Mid( sTemp, 6, 2
sDay( var,i ) = Mid( sTemp, 9, 2
next

response.write "sDay " & (sDay(var,0)) & "<br>
'End Break up dates into variable

'Converts dates to beginning of week (Sunday
today = DateValue(sDate(var,0))
var=var+
for i=0 to 9
firstday = today + 1 - weekday(today, 1
fdw (var,i) = firstday

nex
FirstDayWeek = fdw (var,0
response.Write(fdw(var,0)
response.write(DateDiff("D", sDate(var,0), fdw(var,0))
next

M

#### Maarten

In my country 2 is correct. Check the Format or the LCID

Tim::. said:
I am having some difficulties with the function Datediff! I am trying to
calculate the number of days between two given dates
E.G: Number days between 03-05-2004 and 05-05-2004 = 2

I am using the following piece of asp to extract dates from an XML
document and work with them to create the above mentioned result, however I
can't get it to work.

Thanks

..::XML Example