Fungsi : DateDiff( Interval Type, First Date, Second Date )
Jenis Interval | Keterangan |
---|---|
d | Day (Hari) |
m | Month (Bulan) |
yyyy | Year (Tahun) |
h | Hour (Jam) |
n | Minute (Menit) |
s | Second (Detik) |
ww | Week (Minggu) |
q | Quater (4 Bulan) |
Suppose you want to calculate the difference in days between the date of January 15, 2012 (written # 01/15/2012 #) and 20 Jan 2012, which means it will use a type of interval "d".t = DateDiff("d", #1/15/2012#, #1/20/2012#) , hasilnya 5
If the date obtained from controls such as the DateTimePicker, then the code:t = DateDiff("d", DateTimePicker1.Value, DateTimePicker2.Value)
0 comments:
Post a Comment