473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do you display the system date and time

I want to display the date and time in the long date format
as a form load event. Do I need to link it to a label or a text box?
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     'Form load event display date and time
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         Dim dtmSystemDate As Date = Now 'declare variable for Date
  5.         Dim strNow As String = Now().ToString("D")
  6.     End Sub
  7.  
Thanks
ds
Oct 14 '10 #1
1 1611
danp129
323 Expert 256MB
This belongs in Visual Basic.Net forum.

Which control to use is up to you. I would use a label probably if the user cannot change the date.

If you go with a label called Label1 then you set it as follows:
Expand|Select|Wrap|Line Numbers
  1. Label1.Text=Now().ToString("D")
Oct 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: OtherOne | last post by:
My system clock tends to lose (or sometimes gain) time and I am running some time critical processes so I need to keep the clock synchronized. I wrote the code to get the time from a time server...
1
by: steven virnig | last post by:
We have an application group that wants to pull date from SQL Server and write it to text file on the server. They want the file format to be 12100_YYYMMDDHHMM.fr1 for one set of data,...
1
by: MLH | last post by:
I want to change my system time date each time an A97 app is started. Here's how I've been doing it. Am looking for a better way. Sure some of you have researched this. Function...
3
by: John | last post by:
Hi How can I get the system date and system time (separately)? I have tried now() but it returns both date/time. Thanks Regards
3
by: tahuya_rat | last post by:
Seems like it should be pretty simple to me, but I'm coming up short on answers. I'm not trying to find out how to sync to an atomic clock or anything like that, I just want to know the procedure...
2
by: Colli | last post by:
Hi: I need to setup a continuously updating system Date/Time in my user interface. I can get the system date/time and can cause it to update with a button-click but I can't seem to figure out how...
0
by: andy23 | last post by:
how to display system time and date using a different label.... e.g.. label1 display system time label2 display system date
1
by: pdesh3 | last post by:
Hi, I have a form in which 3 fileds are displayed on the top banner. They are DATE, NAME, LOCATION. 1. I want to make DATE filed dynamic where it whould read system date and display on...
2
by: kkshansid | last post by:
i want to know how to change date formate in visual basic project from control panel???? from mm/dd/yyyy to dd/mm/yyyy in vb calender control
0
by: kkshansid | last post by:
i know about formate function but i want to confirm that if it has anything to do with system date time in controll panel such that dd/mm/yyyy when i formate system it changes to mm/dd/yyyy...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.