> For the complete documentation index, see [llms.txt](https://danfo.jsdata.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danfo.jsdata.org/api-reference/general-functions/danfo.date_range.md).

# danfo.dateRange

danfo.**dateRange**(options)

| Parameters  | Type   | Description                                                                                                                                                                                                                                                                                                                                                             |
| ----------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **options** | Object | <p>Includes any of the following:</p><p><strong>start</strong>: Left bound for generating dates.</p><p><strong>end</strong>: Right bound for generating dates.</p><p><strong>period</strong> : Number of periods to generate.</p><p><strong>offSet</strong>: Date range offset</p><p><strong>freq</strong>: Date range frequency. One of \["M","D","s","H","m","Y"]</p> |

## **Examples**

{% tabs %}
{% tab title="Node" %}

```javascript
const dfd = require("danfojs-node")

let data = new dfd.dateRange({"start":'1/1/2018', period:5, freq:'M'})
console.log(data);
```

{% endtab %}

{% tab title="Browser" %}

```markup
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <!--danfojs CDN -->
    <script src="https://cdn.jsdelivr.net/gh/opensource9ja/danfojs@latest/lib/bundle.js"></script>
    <title>Document</title>
</head>

<body>

    <script>

        let data = new dfd.date_range({"start":'1/1/2018',period:5, freq:'M'})
        console.log(data);
         
    </script>
</body>

</html>
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Output" %}

```
[
  '1/1/2018, 12:00:00 AM',
  '2/1/2018, 12:00:00 AM',
  '3/1/2018, 12:00:00 AM',
  '4/1/2018, 12:00:00 AM',
  '5/1/2018, 12:00:00 AM'
]
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Node" %}

```javascript
const dfd = require("danfojs-node")

let data = new dfd.dateRange({ "start": '1/1/2018', period: 12, freq: 'Y' })
console.log(data);
```

{% endtab %}

{% tab title="Browser" %}

```
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Output" %}

```
[
  '1/1/2018, 12:00:00 AM',
  '1/1/2019, 12:00:00 AM',
  '1/1/2020, 12:00:00 AM',
  '1/1/2021, 12:00:00 AM',
  '1/1/2022, 12:00:00 AM',
  '1/1/2023, 12:00:00 AM',
  '1/1/2024, 12:00:00 AM',
  '1/1/2025, 12:00:00 AM',
  '1/1/2026, 12:00:00 AM',
  '1/1/2027, 12:00:00 AM',
  '1/1/2028, 12:00:00 AM',
  '1/1/2029, 12:00:00 AM'
]
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Datetime properties of Series or datetime-like columns in DataFrame can be accessed via accessors in the **dt** name space. See [Accessors](https://app.gitbook.com/@jsdata/s/danfojs/~/drafts/-MEMaWwva1cjt8CxnG-b/api-reference/series#accessors)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://danfo.jsdata.org/api-reference/general-functions/danfo.date_range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
