我制作的表格应显示伦敦的动态时间。但我只能展示我现在的时间,请帮忙。
代码是:
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
答案 0 :(得分:0)
只需更改
Label1.Text = DateAndTime.TimeOfDay
到
Label1.Text = System.TimeZoneInfo.ConvertTime(Now, TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time")).ToString
查看List of Timezone ID's for use with FindTimeZoneById() in C#?以获取各种时区的列表