Groups | Blog | Home
all groups > vb.net upgrade > september 2003 >

vb.net upgrade : Problem with CDATE() in .NET



Mit
9/25/2003 7:24:43 AM
I am doing conversion VB6 project to VB.NET
in VB6:
CDATE(73991-36161) result 7/28/2003
in VB.NET
CDATE(73991-36161) error: Value of type 'Integer' cannot
converted to 'Date'
What should I do in .Net to get same result?



JohnHart NO[at]SPAM Online.Microsoft.com.com
9/25/2003 11:18:26 PM
Hi Mit,

I just used the VB6 Code Snippet Upgrade Tool in Visual Studio.Net
(Tools/Upgrade Visual Basic 6 Code Menu) to upgrade this VB 6 code and the
upgraded code is:

System.DateTime.FromOADate(73991 - 36161)

Hope that helps.

--
John Hart, Microsoft VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
[quoted text, click to view]
AddThis Social Bookmark Button