Helpo de LibreOfficeDev 25.8
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
Nombro.
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 | Klarigo | 
|---|---|
| 0 | Uzu sisteman aprioran valoron | 
| 1 | Dimanĉe (apriora) | 
| 2 | Lunde | 
| 3 | Marde | 
| 4 | Merkrede | 
| 5 | Ĵaŭde | 
| 6 | Vendrede | 
| 7 | Sabate | 
firstweekofyear: An optional parameter that specifies the starting week of a year.
| firstweekofyear value | Klarigo | 
|---|---|
| 0 | Uzu sisteman aprioran valoron | 
| 1 | Semajno 1 estas la semajno kiu enhavas la unuan de januaro (apriora) | 
| 2 | Semajno 1 estas la unua semajno de la jaro kiu enhavas kvar aŭ pliajn tagojn | 
| 3 | Semajno 1 estas la unua semajno kiu enhavas nur tagojn de la nova jaro | 
Sub example_datediff
    MsgBox DateDiff("d", #1/1/2005#, #2005-12-31#)
End Sub