LibreOffice 24.8 Bantuan
Returns the number of date or time intervals between two given date values.
DateDiff (interval As String, date1 As Date, date2 As Date [, firstDayOfWeek As Integer [, firstWeekOfYear As Integer]]) As Double
Nomor
interval - A string expression from the following table, specifying the date or time interval.
date1, date2 - The two date values to be compared.
firstdayofweek: An optional parameter that specifies the starting day of a week.
| firstdayofweek value | Penjelasan | 
|---|---|
| 0 | Gunakan nilai standar sistem | 
| 1 | Minggu (utama) | 
| 2 | Senin | 
| 3 | Selasa | 
| 4 | Rabu | 
| 5 | Kamis | 
| 6 | Jumat | 
| 7 | Sabtu | 
firstweekofyear: An optional parameter that specifies the starting week of a year.
| firstweekofyear value | Penjelasan | 
|---|---|
| 0 | Gunakan nilai standar sistem | 
| 1 | Pekan 1 adalah pekan dengan Bulan Januari, 1 (default) | 
| 2 | Pekan 1 adalah pekan pertama yang mengandung empat hari atau lebih tahun itu | 
| 3 | Pekan 1 adalah pekan pertama yang hanya berisi hari-hari tahun baru | 
Sub example_datediff
    MsgBox DateDiff("d", #1/1/2005#, #2005-12-31#)
End Sub