LibreOffice 25.2 ヘルプ
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
数値。
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 | 説明 | 
|---|---|
| 0 | システムのデフォルト値を使用 | 
| 1 | 日曜日 (デフォルト) | 
| 2 | 月曜日 | 
| 3 | 火曜日 | 
| 4 | 水曜日 | 
| 5 | 木曜日 | 
| 6 | 金曜日 | 
| 7 | 土曜日 | 
firstweekofyear: An optional parameter that specifies the starting week of a year.
| firstweekofyear value | 説明 | 
|---|---|
| 0 | システムのデフォルト値を使用 | 
| 1 | Week 1 は 1 月 1 日を含む週 (デフォルト) | 
| 2 | Week 1 は、その年の 4 日以上を含む最初の週 | 
| 3 | Week 1 は、新年の日付のみを含む最初の週 | 
Sub example_datediff
    MsgBox DateDiff("d", #1/1/2005#, #2005-12-31#)
End Sub