> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/randomly/.datetime.md).

# .DateTime

`Randomly.DateTime` provides random date, time, and day utilities.

***

### <mark style="color:$success;">Date</mark>

* `Date(min, max)` – Returns a random DateTime between the specified min and max dates.
* `DatePast(daysBack)` – Returns a random past date within the last `daysBack` days.
* `DateFuture(daysForward)` – Returns a random future date within the next `daysForward` days.
* `DateInYear(year)` – Returns a random date within the specified year.
* `DateInMonth(year, month)` – Returns a random date within the specified year and month.

***

### <mark style="color:$success;">Day</mark>

* `Weekday()` – Returns a random day of the week.

***

### <mark style="color:$success;">Time</mark>

* `TimeOfDay()` – Returns a random TimeSpan representing a time of day (hours, minutes, seconds).

***

{% code title="Example.cs" %}

```csharp
// Random future date within next 60 days
DateTime future = Randomly.DateTime.DateFuture(60);

// Random time of day
TimeSpan time = Randomly.DateTime.TimeOfDay();
```

{% endcode %}
