|
-
Aug 3rd, 2000, 09:09 PM
#1
Thread Starter
Frenzied Member
How Do I make my program give the user the Date ad Time for example:
Hello, today is Friday the 5th, and 10:32 PM (time moving)
how do I do that?
I have no idea how to get the systems time and date and stuff
thanks in advance
NXSupport - Your one-stop source for computer help
-
Aug 3rd, 2000, 09:27 PM
#2
Fanatic Member
Code:
Option Explicit
Private Sub Form_Load()
Label1.Caption = "Hello. Today is " & Date & ", and " & Time
End Sub
Private Sub Timer1_Timer()
'//Interval=1000
Label1.Caption = "Hello. Today is " & Date & ", and " & Time
End Sub
-
Aug 3rd, 2000, 09:32 PM
#3
Thread Starter
Frenzied Member
its that simple?
no complicated code?
NXSupport - Your one-stop source for computer help
-
Aug 3rd, 2000, 09:34 PM
#4
Fanatic Member
-
Aug 3rd, 2000, 09:36 PM
#5
Thread Starter
Frenzied Member
ok, I just tried it, and how do I get it to say:
today is Friday the 9th, and 5:00 PM
NXSupport - Your one-stop source for computer help
-
Aug 3rd, 2000, 09:54 PM
#6
Fanatic Member
A little bit more complicated:
Code:
Option Explicit
Private Sub Timer1_Timer()
'//Interval=1000
Dim intDay As Integer
Dim strDay As String
Dim FullDate As String
Select Case Weekday(Date)
Case 1
strDay = "Sunday"
Case 2
strDay = "Monday"
Case 3
strDay = "Tuesday"
Case 4
strDay = "Wednesday"
Case 5
strDay = "Thursday"
Case 6
strDay = "Friday"
Case 7
strDay = "Saturday"
End Select
intDay = Day(Date)
Select Case intDay
Case 1, 21, 31
FullDate = intDay & "st"
Case 2, 22
FullDate = intDay & "nd"
Case 3, 23
FullDate = intDay & "rd"
Case Is > 3, Is < 21, Is > 23, Is < 31
FullDate = intDay & "th"
End Select
Label1.Caption = "Hello. Today is " & strDay & " the " & FullDate & ", and " & Format(Time, "medium time")
End Sub
HTH
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
|