borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Error when connect VB to asp)Next Topic (Nesting If statements within a While Not loop) New Topic New Poll Post Reply
AndreaVB Forum : VB General : help
Poster Message
thelos
Level: Guest


icon help  Archived to Disk

I need to use a timer to help me track time from 12 - GMT + 12. The prefered contries of choice are france, germany, china, spain, Great Britian and Kula lumpa. I must also be able to select a different time zone if required and adapt for daylight savings

22-07-2002 at 11:08 PM
| Quote Reply
Coyote
Level: Guest

icon Re: help  Archived to Disk

Well maybe this will help.  8)
Here is a little project example code. Just open a new project, add two text boxes, add a check box and then add three option buttons to your Form1. Go to each option button and change the name of each to OptionFrance, OptionGermany, & OptionChina
Copy and paste the following code into Form1
' Code Starts Here ****************
Private Sub Check1_Click()
    OptionFrance.Value = False
    OptionGermany.Value = False
    OptionChina.Value = False
    Text2.Text = ""
End Sub

Private Sub Form_Load()
Text1.Text = Time


End Sub



Private Sub OptionFrance_Click()
    Dim Adjust As Integer
    Adjust = 1
        If Check1.Value = Checked Then
        Adjust = Adjust + 1
        End If
    Text2.Text = DateAdd("H", Adjust, Time)
End Sub

Private Sub OptionGermany_Click()
    Dim Adjust As Integer
    Adjust = 2
        If Check1.Value = Checked Then
        Adjust = Adjust + 1
        End If
    Text2.Text = DateAdd("H", Adjust, Time)
End Sub

Private Sub OptionChina_Click()
    Dim Adjust As Integer
    Adjust = 3
        If Check1.Value = Checked Then
        Adjust = Adjust + 1
        End If
        
    Text2.Text = DateAdd("H", Adjust, Time)
End Sub
' ********Code Ends ********

Only thing is..... I can't remember when you go on DayLight Saving Time is add or subtract an hour from the real time.(I added in the code) Plus - this uses your computer time and if your already adjusted for Daylight Savings time then you may not have to adjust unless the country is not on daylight savings time.

SOoooooo you are going to probably have to check the date and hard code the dates to start and stop daylight savings time and do a check on the month and day. Guess I could help with that, but without some research on   daylight savings time... Not much help now... all I know is Fall Back and Spring forward...

28-07-2002 at 12:00 AM
| Quote Reply
AndreaVB Forum : VB General : help
Previous Topic (Error when connect VB to asp)Next Topic (Nesting If statements within a While Not loop) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder