By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

converting Date to long

P: n/a
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?

Feb 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Brian Shafer" <Br*********@discussions.microsoft.com> schrieb
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
Feb 16 '06 #2

P: n/a
Thanks, worked great
"Armin Zingler" <az*******@freenet.de> wrote in message
news:uP*************@TK2MSFTNGP11.phx.gbl...
"Brian Shafer" <Br*********@discussions.microsoft.com> schrieb
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

Feb 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.