-4

I making a form which should show dynamic time of london. But I am only able to show the time of my current contry please help.

Code is :

Public Class Frm_2

Private Sub Frm_2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Timer1.Enabled = True
    Label1.Left = Me.Width - Label1.Width - 50
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    Label1.Text = DateAndTime.TimeOfDay
End Sub

End Class
αғsнιη
  • 2,627
  • 2
  • 25
  • 38

1 Answers1

0

Just change

Label1.Text = DateAndTime.TimeOfDay

to

Label1.Text = System.TimeZoneInfo.ConvertTime(Now, TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time")).ToString

Take a look at List of Timezone ID's for use with FindTimeZoneById() in C#? for the list of various timezeones

Community
  • 1
  • 1
weloytty
  • 5,808
  • 5
  • 28
  • 35