讌
讌 覦 螳 覦覯 覲伎. 覯 襦語 れ j 覲伎.
[1] 螳
' 螳
Dim ClickTime As Date
ClickTime = Date.Now 'Date襯 牛企 譬.
TextBox1.Text = ClickTime '... 2004-03-21 ろ 1:33:21
TextBox1.Text = ClickTime.Year '... 2004
TextBox1.Text = ClickTime.Month '... 3
TextBox1.Text = ClickTime.Day '... 21
TextBox1.Text = ClickTime.Date '... 2004-03-21
TextBox1.Text = ClickTime.Hour '... 13
TextBox1.Text = ClickTime.Minute '... 33
TextBox1.Text = ClickTime.Second '... 21
TextBox1.Text = ClickTime.Millisecond '... 561
TextBox1.Text = ClickTime.DayOfWeek '... 0(殊), 1(), ..., 6()
TextBox1.Text = ClickTime.DayOfYear '... 81(11=1)
' 讌
Dim ClickTime As Date
ClickTime = Date.Today
TextBox1.Text = ClickTime '... 2004-03-21
TextBox1.Text = ClickTime.Hour '... 0 '讌危 覲企 .
TextBox1.Text = ClickTime.DayOfYear '... 81
[2] 螳 襷り鍵
'螳覲 襷り鍵
Dim myTime As Date
myTime = New Date(2004, 3, 21)
myTime = New Date(2004, 3, 21, 13, 33, 21)
TextBox1.Text = myTime
[3] 螳 螳蟆
'螳覲 襷り鍵
Dim myTime1, myTime2 As Date
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = New Date(2004, 3, 15, 4, 18, 33)
Dim TimeDiff As TimeSpan = myTime1.Subtract(myTime2)
TextBox1.Text = TimeDiff.ToString '6.09:14:48
TextBox1.Text = TimeDiff.Days '6
TextBox1.Text = TimeDiff.Hours '9
TextBox1.Text = TimeDiff.TotalHours '153.246666666667
'蠍壱 Minutes, Seconds, Milliseconds 襷谿螳讌
'蟇郁掌襦 覃 螳 襷企り .
[4] 螳 螳螳
Dim myTime1, myTime2 As Date
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = myTime1.AddYears(-2)
myTime2 = myTime2.AddMonths(5)
TextBox1.Text = myTime2 '...2002-08-21 ろ 1:33:21
るジ
Dim myTime1, myTime2 As Date
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = myTime1.AddMonths(-22)
TextBox1.Text = myTime2 '...2002-05-21 ろ 1:33:21
[5] TimeSpan 螳 螳螳
Dim myTime1, myTime2 As Date
Dim TimeDiff = New TimeSpan(150, 0, 0, 0) '150
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = myTime1.Add(TimeDiff)
TextBox1.Text = myTime2 '...2004-08-18 ろ 1:33:21
るジ
Dim myTime1, myTime2 As Date
Dim TimeDiff = New TimeSpan(150, 0, 0, 0) '150
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = myTime1.Subtract(TimeDiff)
TextBox1.Text = myTime2 '...2003-10-23 ろ 1:33:21
[6] 襦 覲
Dim myTime1, myTime2 As Date
myTime1 = New Date(2004, 3, 21, 13, 33, 21)
myTime2 = New Date(2004, 3, 21, 13, 33, 22)
Dim X1 As Double = myTime1.ToOADate '38067.5648263889
Dim X2 As Double = myTime2.ToOADate '38067.564837963
TextBox1.Text = X2 - X1 '1.15740767796524E-05 = 0.0000115740
[豢豌] vb.net 讌 螳 蟯|煙 伎拘襭