# DAYS

**The function DAYS takes either two DateTimes or two Dates, and returns the number of days between them.**

This function takes two pieces of input: either two [Dates](../../variable-data-types/the-date-variable-data-type) or two [DateTimes](../../variable-data-types/the-datetime-variable-data-type). It outputs a Number: the number of days between the two DateTimes.

#### Declaration

```javascript
DAYS(datetime1, datetime2) -> days
```

```javascript
DAYS(date1, date2) -> days
```

&#x20;

#### Parameters

**datetime1** (type: _DateTime_) Any DateTime.

**datetime2** (type: _DateTime_) Any DateTime.

**date1** (type: _Date_) Any Date.

**date2** (type: _Date_) Any Date.

#### Return Values

**days** (type: _Number_) The number of days between two dates.

#### Examples

Assume the first two examples have access to the following DateTime values:

```javascript
example_date_and_time1 = {  
 "date": {  
  "day": 1,  
  "month": 4,  
  "year": 2021  
 },  
 "time": {  
  "hour": 16,  
  "minute": 14,  
  "second": 38,  
  "millisecond": 0  
 },  
 "timeZone": "UTC"  
}  
  
example_date_and_time2 = {  
 "date": {  
  "day": 16,  
  "month": 5,  
  "year": 2021  
 },  
 "time": {  
  "hour": 12,  
  "minute": 46,  
  "second": 12,  
  "millisecond": 4  
 },  
 "timeZone": "UTC"  
}
```

The following example outputs the number of days between **example\_date\_and\_time1** and **example\_date\_and\_time2**:

```javascript
DAYS(example_date_and_time1, example_date_and_time2) = 44
```

The DAYS function returns the absolutely number of days between the two given dates; it doesn't matter what order they are given. The following example outputs the number of days between **example\_date\_and\_time2** and **example\_date\_and\_time1**; note that this output is exactly the same as in the above example.

```javascript
DAYS(example_date_and_time2, example_date_and_time1) = 44
```

The previous examples showcased how the DAYS function behaves when given DateTimes as input. To demonstrate how it behaves when given Dates, assume the last example has access to the following Date values:

```javascript
example_date1 = {  
 "day": 1,  
 "month": 4,  
 "year": 2021  
}  
  
example_date2 = {  
 "day": 16,  
 "month": 5,  
 "year": 2021  
 }
```

The following outputs the number of days between **example\_date1** and **example\_date2**. Note that the dates described by these Dates is the same as the dates described by the DateTimes given above, and so the output is exactly the same:

```javascript
DAYS(example_date1, example_date2) = 44
```
