LibreOfficeDev 25.8:n ohje
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
Luku.
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 | Selitys | 
|---|---|
| 0 | käyttöjärjestelmän oletusarvo | 
| 1 | sunnuntai (oletus) | 
| 2 | maanantai | 
| 3 | tiistai | 
| 4 | keskiviikko | 
| 5 | torstai | 
| 6 | perjantai | 
| 7 | lauantai | 
firstweekofyear: An optional parameter that specifies the starting week of a year.
| firstweekofyear value | Selitys | 
|---|---|
| 0 | käyttöjärjestelmän oletusarvo | 
| 1 | viikolla, johon kuuluu 1. tammikuuta, on viikkonumero 1 (oletus) | 
| 2 | vuoden ensimmäisellä sellaisella viikolla, jossa on päiviä neljä tai enemmän, on viikkonumero 1 | 
| 3 | vuoden ensimmäinen kokonainen viikko, jossa on vain uuden vuoden päiviä, saa viikkonumero 1:n | 
Sub example_datediff
    MsgBox DateDiff("d", #1/1/2005#, #2005-12-31#)
End Sub