Imports System Public Class Greeting Shared Sub Main() Dim dtCurrent As System.DateTime Dim iHour As Integer dtCurrent = dtCurrent.Now() iHour = dtCurrent.Hour If (iHour < 12) Then Console.Writeline("Good Morning!") End If If (iHour >= 12) And (iHour < 18) Then Console.WriteLine("Good Afternoon!") End If If (iHour >= 18) Then Console.WriteLine("Good Evening!") End If End Sub End Class
Good Afternoon!
5.5.DateTime | ||||
5.5.1. | Get Date from long integer | |||
5.5.2. | Get UniversalTime from DateTime | |||
5.5.3. | DateTime.Parse(12:00:00 PM) | |||
5.5.4. | DateTime parse date and time by DateTimeFormatInfo | |||
5.5.5. | DateTime Subtract | |||
5.5.6. | Get Hour from DateTime | |||
5.5.7. | Timing code block | |||
5.5.8. | Displays the total number of weeks in the current year. |