'   Declarations
        Dim dtNow As DateTime = DateTime.Now
        Dim intHour As Integer = Now.Hour
        Dim intMin As Integer = Now.Minute
        Dim intSec As Integer = Now.Second

        '  Logic
        If intHour < 12 Then
            lblGreeting.Text = "Good Morning"
        ElseIf intHour > 12 & intHour < 18 Then
            lblGreeting.Text = "Good Afternoon!"
        Else
            lblGreeting.Text = "Good Evening!"
        End If

        '   <summary>
        '   Sample examples of DateTime Strings you can use
        '   
        '   DateTime String                 Sample Result
        '       "D"                     Thursday, February 01, 2001
        '       "d"                     2/01/2001
        '       "f"                     Thursday, February 01, 2001 4:32 PM
        '       "F"                     Thursday, February 01, 2001 4:32:30 PM
        '       "g"                     2/01/2001 4:32 PM
        '       "G"                     2/01/2001 4:32:30 PM
        '       "m"                     February 01
        '       "t"                     4:32 PM
        '       "T"                     4:32:30 PM
        '       "dddd, MMMM dd yyyy"    Thursday, February 01 2001
        '   
        '   </summary>

        lblDate.Text = "The Current Date and Time is: " + Now.ToString("F")

THANX MAN....this is a good one. after i saw smone code a clock in VB....I always wanted to know how that works b'cos i noticed that everytime it run, it was synchronized with the time on the pc.
thanx for opening ma mind, thanx


Aj..

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.