dim d1 As DateTime = Convert.ToDateTime("10/06/2013 10:00:00");
dim d2 As DateTime = Convert.ToDateTime("11/06/2013 12:00:00");
dim v1 As double = d2.Subtract(d1).TotalHours;
'v1 ค่าผลรวมชั่วโมงครับ
Dim d1 As New Date(2013, 5, 20)
Dim d2 As New Date(2013, 6, 30)
While (d1 <= d2)
Me.cboTest.Items.Add(d1.ToString("dd/MM/yyyy"))
d1 = d1.AddDays(1)
End While
dim d1 As DateTime = Convert.ToDateTime("01/06/2013 10:00:00")
dim d2 As DateTime = Convert.ToDateTime("11/06/2013 10:00:00")
dim s1 As string = string.Empty
Do While (d1.CompareTo(d2) < 1)
s1 += d1.ToString() + Environment.NewLine
d1 = d1.AddDays(1)
Loop
MessageBox.Show(s1.ToString())