Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to convert datetime to integer

Hi All,

I'm trying this code to mesure the time a simple loop need with ASP+

I get a compilation error stating that Date type can't be converted to Integer
(idem with long integer) and simple diffrence of 2 dates (date1-date2) isn't
allowed.

How can I solve ?
Where can I find ASP+ syntaxe and function rfrence ?

<%
dim EmBegin, EmEnd as Date
dim EmDelta as Integer

EmBegin = DateTime.Now

for i=1 to 100
response.write (i & "<br>")
next

EmEnd = DateTime.Now

EmDelta = EmEnd - EmBegin

response.write (EmDelta )
%>
[653 byte] By [emmanuel] at [2007-11-9 16:23:39]
# 1 Re: How to convert datetime to integer
Hey,
I'm new in VB but I think you can use DateDiff for measuring the difference
between 2 dates

--
Regards,
Bart ten Velde
Integrated Network Solutions - www.inseurop.com
Enabling Your Future Technology

"emmanuel" <emeurant@hotmail.com> wrote in message
news:39940d26$1@news.dev-archive.com...
>
> Hi All,
>
> I'm trying this code to mesure the time a simple loop need with ASP+
>
> I get a compilation error stating that Date type can't be converted to
Integer
> (idem with long integer) and simple diffrence of 2 dates (date1-date2)
isn't
> allowed.
>
> How can I solve ?
> Where can I find ASP+ syntaxe and function rfrence ?
>
> <%
> dim EmBegin, EmEnd as Date
> dim EmDelta as Integer
>
> EmBegin = DateTime.Now
>
> for i=1 to 100
> response.write (i & "<br>")
> next
>
> EmEnd = DateTime.Now
>
> EmDelta = EmEnd - EmBegin
>
>
> response.write (EmDelta )
> %>
>
Bart ten Velde at 2007-11-11 23:26:29 >