Contents

# DateDiff Function

Returns the number of date or time intervals between two given date values.

### Syntax:

    DateDiff (interval As String, date1 As Date, date2 As Date [, firstDayOfWeek As Integer [, firstWeekOfYear As Integer]]) As Double

## Gatii deebii:

Lakkoofsi

### Parameters:

interval - A string expression from the following table, specifying the date or time interval.

interval (string value) | Ibsa
--- | ---
yyyy | Waggaa
q | Kumaana
m | Ji'a
y | Guyyaa Waggaa
w | Guyyaa Torbee
ww | Torbee Waggaa
d | Guyyaa
h | Sa'aa
n | Daqiiqaa
s | Sekandii

date1, date2 - The two date values to be compared.

Date literals allow to specify unambiguous date variables that are independent from the current language. Literals are enclosed between hash signs #. Possible formats are:

- #yyyy-mm-dd#

- #mm/dd/yyyy#

firstdayofweek: An optional parameter that specifies the starting day of a week.

firstdayofweek value | Ibsa
--- | ---
0 | Gatii sirna Durtii fayyadami
1 | Dilbata(Duurtii)
2 | Wixata
3 | Kibxata
4 | Roobii
5 | Kamisa
6 | Jimaata
7 | Sanbata

firstweekofyear: An optional parameter that specifies the starting week of a year.

firstweekofyear value | Ibsa
--- | ---
0 | Gatii sirna Durtii fayyadami
1 | Torbeen 1 torbee Amajjii waliin, 1st(durtii)
2 | Torbeen 1 torbee tokkoffaa guyyoota bara sanaa afur ykn isaa ol kan of keessaa qabu
3 | Torbeen 1 torbee tokkoffaa guyyoota waggaa haraa qofa of keessaa qabu

### Example:

    Sub example_datediff
        MsgBox DateDiff("d", #1/1/2005#, #2005-12-31#)
    End Sub