Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Working with dates and times


Message #1 by "Anders Lundholm" <lundholm@s...> on Tue, 28 Nov 2000 13:22:24 +0100
Fredrik!



When I did the ADODB test, I used the DateTime class. But, I was unable 

to create two datetime variables and subtract them from eachother! The 

documentation stated, then when subtracting two datetimes (constructed 

with the 'now' method), the outcome was a TimeSpan type (perhaps this is 

because I wanted to work with the milliseconds too).



How come? Could you post your code, please?



I mean, in regular ASP you use:

dtmStart =3D Now()

'## CODE GOES HERE

dtmEnd =3D Now()

Response.Write(FormatDateTime(dtmEnd - dtmStart)



In ASP.NET its much more 'hardcore' to do simple timing stuff. I bet 

this is because I've always been used to the easy of use with variants.



With Regards

Anders Lundholm - lundholm@s...

--







Message #2 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Tue, 28 Nov 2000 14:00:33 +0100
hi,



I use Timer instead of Now.

For example:



Response.Write("Start: " & Timer().ToString)



You can also set Trace to true in ASP.NET.

I will send you my code..



/Fredrik Normén





-----Original Message-----

From: Anders Lundholm [mailto:lundholm@s...]

Sent: den 28 november 2000 13:22

To: ASP+

Subject: [aspx] Working with dates and times





Fredrik!



When I did the ADODB test, I used the DateTime class. But, I was unable to

create two datetime variables and subtract them from eachother! The

documentation stated, then when subtracting two datetimes (constructed with

the 'now' method), the outcome was a TimeSpan type (perhaps this is because

I wanted to work with the milliseconds too).



How come? Could you post your code, please?



I mean, in regular ASP you use:

dtmStart = Now()

'## CODE GOES HERE

dtmEnd = Now()

Response.Write(FormatDateTime(dtmEnd - dtmStart)



In ASP.NET its much more 'hardcore' to do simple timing stuff. I bet this is

because I've always been used to the easy of use with variants.



With Regards

Anders Lundholm - lundholm@s...

--








  Return to Index