Digital Clock

How to create a clock in Programming

Database Management System is one of the project which are mostly to apply for every bachelor students to be completed in their academic; however most of the system should have some features to show off their projects such as Calendar, clocks, etc. in their dashboard.

Design Form in

To create Clock in, you need to create project, by going to Visual Studio 2015( I used version 2015) then New Project after that in the Template –> Select In the right panel, please select Window Forms Application.

    In the Name, please name as Digital Clock then click Ok

    Go to Toolbox in the left side of your Form1, then select Label and Timer to drop on your form then Name your Label to lbtime and Timer to DigitalTime. In your Timer, please change the Time Interval to 1000

      Start Coding in

      By double click on your Form1 then write the code in the Form_Load Event as below:

      Public Class Form1
          Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
              Me.DigitalTime.Enabled = True
          End Sub
      End Class

      On the Digital Timer which it were named from Timer, please double click on it the write the code below:

        Private Sub DigitalTime_Tick(sender As Object, e As EventArgs) Handles DigitalTime.Tick
                Me.lbtime.Text = "Current Date:" & Date.Now.ToString("dd-mm-yyyy hh:mm:ss")
            End Sub

        The result after click on Start:

          *** Date.Now.ToString(“dd-mm-yyyy hh:mm:ss”) is the build-in function which is coming with programming and it can be applied to any toolbox as you wishes