Home » » Calculating Date Difference

Calculating Date Difference

When you need a code to calculate the date difference between 2 data either day, month, or year, the following example:

Fungsi : DateDiff( Interval Type, First Date, Second Date )

Jenis IntervalKeterangan
dDay (Hari)
mMonth (Bulan)
yyyyYear (Tahun)
hHour (Jam)

nMinute (Menit)
sSecond (Detik)
wwWeek (Minggu)
qQuater (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)
Jika Anda menyukai Artikel di blog ini, Silahkan klik disini untuk berlangganan gratis via email, dengan begitu Anda akan mendapat kiriman artikel setiap ada artikel yang terbit di Creating Website

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Sanjaya Catur Blogging - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger