|
-
Jun 6th, 2001, 02:48 PM
#1
Thread Starter
Member
Changing System Time
Is there a way to change the system time through VB. I found datetime.time control but I am at a loss on how to pass the new value to it.
Could anyone help me???
Thanks
Everyone!!! Can I have your attention please?
Sit back, Relax and watch the world unfold before your very eyes.
Mystical isn't it, oh well I tried!!!
-
Jun 6th, 2001, 03:09 PM
#2
use the Time statement 
I think that works
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jun 6th, 2001, 03:46 PM
#3
Thread Starter
Member
Thanks
Thanks for the response!!
I tried that but I couldn't get it to work. However, I did find a function called timevalue which turns a string value into a usable to value for the time command.
Everyone!!! Can I have your attention please?
Sit back, Relax and watch the world unfold before your very eyes.
Mystical isn't it, oh well I tried!!!
-
Jun 6th, 2001, 04:06 PM
#4
_______
<?>
'you have to double click the clock icon in the systray for it to take effect
Private Sub Form_Load()
Dim MyTime
MyTime = "11:00:00 PM"
Time = MyTime
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 8th, 2001, 09:52 AM
#5
Thread Starter
Member
In the situation I need this in that would not be acceptable.
Private Sub subSetTime()
Dim tmpMin As String
Dim tmpTime As Variant
Dim tmpDelim As String
Dim tmpHour As Integer
If Len(cmbMins.Text) = 1 Then tmpMin = "0" & cmbMins.Text Else tmpMin = cmbMins.Text
If Val(cmbHrs.Text) > 12 Then
tmpHour = Val(cmbHrs.Text) - 12
tmpDelim = " PM"
Else
tmpDelim = " AM"
tmpHour = cmbHrs.Text
End If
tmpTime = TimeValue(Val(tmpHour) & ":" & Val(tmpMin) & ":00" & tmpDelim)
Call SetTime(tmpTime)
Everyone!!! Can I have your attention please?
Sit back, Relax and watch the world unfold before your very eyes.
Mystical isn't it, oh well I tried!!!
-
Jun 8th, 2001, 10:19 AM
#6
Hyperactive Member
I got a French computer... ;Does the time have to be entered as american time or International time (10:00 pm = 22:00)
-
Jun 8th, 2001, 10:45 AM
#7
_______
<?>
Code:
'the system time is changed
'but if you want to see the changed time in the systray
'you have to double click the clock icon in the systray for it to take effect
'
'to test it run the code..your msgbox will give you the system time of 11 oclock pm
Private Sub Command1_Click()
MsgBox Now
End Sub
Private Sub Form_Load()
Dim MyTime
MyTime = "11:00:00 PM"
Time = MyTime
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 8th, 2001, 10:46 AM
#8
_______
<?>
Mastermind.
just do a msgbox now in some event and see how your time is displayed and act accordingly.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 11th, 2001, 07:16 AM
#9
Thread Starter
Member
Mastermind. . . . . .
The time format is in international time 10:00pm = 22:00. If you look at the tmphours line I am converting the time from international to american. You will need to expirement with the code.
The SetTime sub uses the DateTime.Time function to set the time for me. If you have any other questions regarding it let me know.
Everyone!!! Can I have your attention please?
Sit back, Relax and watch the world unfold before your very eyes.
Mystical isn't it, oh well I tried!!!
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
|