converting Date to long

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In vb 6 i had a something like result = CLng(UserDate) - CLng(MyDate)
in vb.net I get an error
"Value of tyep 'Date' cannot be converted to 'Long'.

How do i get around this?
 
Brian Shafer said:
In vb 6 i had a something like result = CLng(UserDate) -
CLng(MyDate) in vb.net I get an error
"Value of tyep 'Date' cannot be converted to 'Long'.

How do i get around this?

Use the object's methods:

Dim diff as timespan

diff = userdate.subtract(mydate)


Then access the Timespan's members.


Armin
 
Thanks, worked great


Armin Zingler said:
Use the object's methods:

Dim diff as timespan

diff = userdate.subtract(mydate)


Then access the Timespan's members.


Armin
 
Back
Top