Results 1 to 4 of 4

Thread: Display System date & time to VB application

  1. #1
    Join Date
    Feb 2009
    Posts
    12

    Display System date & time to VB application

    Hi,
    I want to display date & time on the form of my Vb project & i need help about what is the best way to do this?
    How should i refresh it?

  2. #2
    Join Date
    May 2008
    Posts
    40

    Re: Display System date & time to VB application

    Code:
    Text1.Text = Format(Now, "mm/dd/yyyy hh:mm:ss")
    But u should put this in a timer and set the interval to 1000 if you want to
    update it every second.

  3. #3
    Join Date
    May 2008
    Posts
    115

    Re: Display System date & time to VB application


  4. #4
    Join Date
    May 2008
    Posts
    72

    Re: Display System date & time to VB application

    Place the Label on the form where you want the display to appear. Do you want the time to continuously update (say every minute?)

    If you just want to have the current date and time when the form opens:

    in the Form_Load event:

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    MyDateandTimeLabel.Text = Date.Now.ToString("dd MMM yyyy hh:mm:ss")
    End Sub

Similar Threads

  1. Replies: 2
    Last Post: 29-11-2011, 09:29 AM
  2. Replies: 4
    Last Post: 19-10-2010, 06:55 AM
  3. Replies: 2
    Last Post: 06-08-2009, 10:21 AM
  4. How can I display system date & time on my webpage?
    By JangoRap in forum Software Development
    Replies: 3
    Last Post: 16-02-2009, 07:40 PM
  5. Replies: 4
    Last Post: 23-07-2008, 06:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,643,532.62185 seconds with 17 queries