?
Solved

Convert Date to Long? Like in VB6

Posted on 2004-10-07
6
Medium Priority
?
1,086 Views
Last Modified: 2012-08-14
Hey guys,

I have some code in vb6:
        date = CLng(cdate("10/7/2004")
And it returns 38284
That is what i want to do in .net


If i try this in VB.Net, it says I cannot convert date to long. WHAT DO I DO?
0
Comment
Question by:Level10Access
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 140 total points
ID: 12251811
Dim intDateSerial As Integer = DateTime.Parse("10/7/2004").ToADate

Bob
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 12252060
i think what Bob means is...

Dim intDateSerial As Long = DateTime.Parse("10/7/2004").ToOADate

~b
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12252071
No, I meant Integer.  In VB6, Long = 32-bit, and in VB.NET Integer = 32.

Bob
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:Level10Access
ID: 12252086
You meant ToOADate not ToADate. Figured that out. Thanks alot man. You've got the points!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12252104
Yeah, ToOADate.  Typing in the comment block, without auto-complete :)

Bob
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 12252152
yea...i meant the ToOADate thing...

go ahead and give these pts to bob if you werent going to before...i really didnt do a whole lot here

~b
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question