设计界面双击那个按钮(自动跳到代码里)
网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了南康免费建站欢迎大家使用!
然后输入 要显示时间的那个Label.Text = DateTime.Now.ToString()
不是 有 函数嘛?
now() 就是 吧
取得 后 再 分离出你所需的,分别赋值 就行了,当然 还是 有 函数的
Dim ThisDay As String = Format(Now, "yyyy-MM-dd") '获得当前日期字符串
Dim ThisDateTime As DateTime = Convert.ToDateTime(ThisDay) '当前日期转换成DateTime
Dim ThisWeekDay As Integer = ThisDateTime.DayOfWeek '获得当前日期是星期几
Dim differadd As Integer = 1 - ThisWeekDay '相差的天数(星期1与当前星期几相差的天数)
Dim MyAdd As New TimeSpan(differadd, 0, 0, 0)
Dim MyYear As Integer = Format(Now, "yyyy") '获取当前日期的年份
Dim MyMonth As Integer = Format(Now, "MM") '获取当前日期的月份
Dim MyDay As Integer = Format(Now, "dd") '获取当前日期是几号
Dim MyToday As DateTime = New DateTime(MyYear, MyMonth, MyDay)
Dim Yourday As DateTime = MyToday.Add(MyAdd)
MsgBox("本周星期一的日期是:" Yourday)
Label1.Text = "12时演示:" + Now.ToString("yyyy-MM-dd hh:mm:ss")
Label2.Text = "24时演示:" + Now.ToString("yyyy-MM-dd HH:mm:ss")
Label3.Text = "UTC时演示:" + System.DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss")
Label4.Text = "时间为不补0:" + Now.ToString("yyyy-MM-dd H:m:s")
Label5.Text = "时间戳:" + CLng(System.DateTime.UtcNow.Subtract(New Date(1970, 1, 1, 0, 0, 0)).TotalMilliseconds).ToString