Prashant More

Prashant More

  • NA
  • 87
  • 166k

How to solve this problem

Oct 21 2008 9:19 AM

Hello All,

I am doing a console application in vb.net as follows

Class Sample
    Public Shared d As Integer
    Public Shared m As Integer
    Public Shared y As Integer


    Shared Sub New()
        Dim dt As DateTime = DateTime.Now
        d = dt.Day
        m = dt.Month
        y = dt.Year
    End Sub
    Public Shared Sub Display()
        Console.WriteLine("Day" + d + "Month" + m + "Year" + y)
    End Sub

    Shared Sub Main()
        Sample.Display()
    End Sub

End Class


The problem is in the statements

d = dt.Day
        m = dt.Month
        y = dt.Year

Now how can i convert the Day type into double and Month,Year into double.

Please anyone send me the code in vb.net

Thanks & Regards

Prashant S. More


Answers (2)