設(shè)計(jì)界面雙擊那個(gè)按鈕(自動(dòng)跳到代碼里)
網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了南康免費(fèi)建站歡迎大家使用!
然后輸入 要顯示時(shí)間的那個(gè)Label.Text = DateTime.Now.ToString()
不是 有 函數(shù)嘛?
now() 就是 吧
取得 后 再 分離出你所需的,分別賦值 就行了,當(dāng)然 還是 有 函數(shù)的
Dim ThisDay As String = Format(Now, "yyyy-MM-dd") '獲得當(dāng)前日期字符串
Dim ThisDateTime As DateTime = Convert.ToDateTime(ThisDay) '當(dāng)前日期轉(zhuǎn)換成DateTime
Dim ThisWeekDay As Integer = ThisDateTime.DayOfWeek '獲得當(dāng)前日期是星期幾
Dim differadd As Integer = 1 - ThisWeekDay '相差的天數(shù)(星期1與當(dāng)前星期幾相差的天數(shù))
Dim MyAdd As New TimeSpan(differadd, 0, 0, 0)
Dim MyYear As Integer = Format(Now, "yyyy") '獲取當(dāng)前日期的年份
Dim MyMonth As Integer = Format(Now, "MM") '獲取當(dāng)前日期的月份
Dim MyDay As Integer = Format(Now, "dd") '獲取當(dāng)前日期是幾號(hào)
Dim MyToday As DateTime = New DateTime(MyYear, MyMonth, MyDay)
Dim Yourday As DateTime = MyToday.Add(MyAdd)
MsgBox("本周星期一的日期是:" Yourday)
Label1.Text?=?"12時(shí)演示:"?+?Now.ToString("yyyy-MM-dd?hh:mm:ss")
Label2.Text?=?"24時(shí)演示:"?+?Now.ToString("yyyy-MM-dd?HH:mm:ss")
Label3.Text?=?"UTC時(shí)演示:"?+?System.DateTime.UtcNow.ToString("yyyy-MM-dd?HH:mm:ss")
Label4.Text?=?"時(shí)間為不補(bǔ)0:"?+?Now.ToString("yyyy-MM-dd?H:m:s")
Label5.Text?=?"時(shí)間戳:"?+?CLng(System.DateTime.UtcNow.Subtract(New?Date(1970,?1,?1,?0,?0,?0)).TotalMilliseconds).ToString