|
-
Jul 20th, 2007, 04:18 AM
#1
Thread Starter
Addicted Member
[RESOLVED] displaying system date and time
hello,
could anyone tell me how to display the system date and time in a label?
i would like to do it so when a user logs on the labels text changes to display the users name and the date and time that they logged in!
thank you,
iain
-
Jul 20th, 2007, 04:21 AM
#2
Re: displaying system date and time
In the form load event just put:
vb Code:
Me.Label1.Text = Date.Now.Tostring
You can also mess around with the toString bit and use it to format the date/time
-
Jul 20th, 2007, 04:28 AM
#3
Thread Starter
Addicted Member
Re: displaying system date and time
yeah thats got it!
thanks a lot
-
Jul 20th, 2007, 04:33 AM
#4
Thread Starter
Addicted Member
Re: displaying system date and time
1 other thing,
how do i get it so it displays the persons name before it?
i tried.....
me.lblfeedback.text = '" & Name & "' Logged in Date.Now.ToString
it didnt like it!
-
Jul 20th, 2007, 04:37 AM
#5
Thread Starter
Addicted Member
Re: displaying system date and time
oooh i got it.......
lblfeedback.text = (" " & Name & " Logged in ") & date.now.tostring
thanks for putting me on the right track Stimbo!!!!!!!
-
Jul 20th, 2007, 04:39 AM
#6
Re: [RESOLVED] displaying system date and time
I think this might be it:
vb Code:
me.lblfeedback.text = System.Environment.UserName & " Logged in at: " & date.now.tostring
-
Jul 20th, 2007, 05:12 AM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] displaying system date and time
how would i get it so the clock refreshes and constantly displays the correct time?
-
Jul 20th, 2007, 05:16 AM
#8
Re: [RESOLVED] displaying system date and time
Add a timer to your project, enable it and in the tick event put the code you have
-
Jul 20th, 2007, 05:21 AM
#9
Thread Starter
Addicted Member
Re: [RESOLVED] displaying system date and time
cheers, i should have thought of that!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|