Dim daysInMonth As Integer = Date.DaysInMonth(Now.Year, Now.Month)
MsgBox(String.Format("Number of days in the current month: {0}", daysInMonth))
|
|||||
|
Dim daysInMonth As Integer = Date.DaysInMonth(Now.Year, Now.Month) MsgBox(String.Format("Number of days in the current month: {0}", daysInMonth)) Dim leapYear As Boolean = Date.IsLeapYear(Now.Year) MsgBox(String.Format("{0} is a leap year: {1}", Now.Year, leapYear)) Dim rightNow As Date = Now Dim result As New System.Text.StringBuilder result.Append("Date: ").AppendLine(rightNow.ToShortDateString) result.Append("Time: ").AppendLine(rightNow.ToShortTimeString) MsgBox(result.ToString()) this will display the exact date and time when the program is run Public Class Form1 |
|||||
|
Copyright © 2010 Codetuts VB.net - All Rights Reserved |
|||||