Time (hour) question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ReidarT

    #1

    Time (hour) question

    On the load event of a VB.NET web-form I use format(DateTime .Now,"HH:mm") to
    get the time in a textfield.
    I want the field to show the next half hour, like 12:30, 13:00, 13:30 and so
    on. How can I add something to the
    code to achieve this?
    regards
    reidarT


  • Darren Barrick

    #2
    Re: Time (hour) question

    How about something like (not tested)

    dim currentDate AS date = Date.now
    DIm formattedTime AS string

    IF currentDate.min ute < 30 Then
    formattedTime = Format(currentD ate, "HH:") & "30"
    Else
    formattedTime = Format(currentD ate.AddHour(1), "HH:") & "00"
    End If

    "ReidarT" <reidar@eivon.n o> wrote in message
    news:uABXmOVXFH A.2796@TK2MSFTN GP09.phx.gbl...[color=blue]
    > On the load event of a VB.NET web-form I use format(DateTime .Now,"HH:mm")
    > to get the time in a textfield.
    > I want the field to show the next half hour, like 12:30, 13:00, 13:30 and
    > so on. How can I add something to the
    > code to achieve this?
    > regards
    > reidarT
    >[/color]


    Comment

    Working...