date Domain
The date domain maps domain keywords to underlying faker implementations.
Faker Documentation
Methods
date.anytime
Generates a random date that can be either in the past or in the future.
- Canonical:
awd.domain.date.anytime - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
Examples:
date.anytime()
Example return values:
"2026-12-25T08:55:20.593Z"
date.between
Generates a random date between the given boundaries.
- Canonical:
awd.domain.date.between - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
from | integer | no | Start boundary as a Unix timestamp in milliseconds since epoch. |
to | integer | no | End boundary as a Unix timestamp in milliseconds since epoch. |
Examples:
date.between(0, 2000000000000)
Example return values:
2026-01-15T12:34:56.000Z
date.betweens
Generates random dates between the given boundaries. The dates will be returned in an array sorted in chronological order.
- Canonical:
awd.domain.date.betweens - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
count | integer | no | The number of dates to generate. |
from | integer | no | Start boundary as a Unix timestamp in milliseconds since epoch. |
to | integer | no | End boundary as a Unix timestamp in milliseconds since epoch. |
Examples:
date.betweens(2, 0, 2000000000000)
Example return values:
["2026-01-15T12:34:56.000Z","2026-02-01T09:00:00.000Z"]
date.birthdate
Returns a random birthdate. By default, the birthdate is generated for an adult between 18 and 80 years old.
- Canonical:
awd.domain.date.birthdate - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
max | integer | no | The maximum age/year to generate a birthdate for/in. |
min | integer | no | The minimum age/year to generate a birthdate for/in. |
mode | string | no | Either 'age' or 'year' to generate a birthdate based on the age or year range. |
Examples:
date.birthdate(refDate=20000, max=69, min=16, mode="age")
Example return values:
"1966-09-18T08:47:31.333Z"
date.future
Generates a random date in the future.
- Canonical:
awd.domain.date.future - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
years | integer | no | The range of years the date may be in the future. |
Examples:
date.future()
Example return values:
"2027-02-07T18:41:48.525Z"
date.month
Returns a random name of a month.
- Canonical:
awd.domain.date.month - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
abbreviated | boolean | no | Whether to return an abbreviation. |
context | boolean | no | Whether to return the name of a month in the context of a date. In the currently supported locale this has no visible effect. This option is mainly relevant for future multi-locale support (for example, locale-specific grammar/capitalization differences). |
Examples:
date.month()
date.month(abbreviated=false, context=false)
Example return values:
February
date.past
Generates a random date in the past.
- Canonical:
awd.domain.date.past - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
years | integer | no | The range of years the date may be in the past. |
Examples:
date.past()
Example return values:
"2025-07-01T11:48:55.347Z"
date.recent
Generates a random date in the recent past.
- Canonical:
awd.domain.date.recent - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
days | integer | no | The range of days the date may be in the past. |
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
Examples:
date.recent()
Example return values:
"2026-04-27T23:46:16.707Z"
date.soon
Generates a random date in the near future.
- Canonical:
awd.domain.date.soon - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
days | integer | no | The range of days the date may be in the future. |
refDate | integer | no | Reference date as a Unix timestamp in milliseconds since epoch used as the generation anchor. |
Examples:
date.soon()
Example return values:
"2026-04-29T11:09:09.211Z"
date.timeZone
Returns a random IANA time zone relevant to this locale.
- Canonical:
awd.domain.date.timeZone - Faker docs: https://fakerjs.dev/api/date
No parameters.
Examples:
date.timeZone()
Example return values:
Europe/Stockholm
date.weekday
Returns a random day of the week.
- Canonical:
awd.domain.date.weekday - Faker docs: https://fakerjs.dev/api/date
| Arg | Type | Required | Description |
|---|---|---|---|
abbreviated | boolean | no | Whether to return an abbreviation. |
context | boolean | no | Whether to return the day of the week in the context of a date. In the currently supported locale this has no visible effect. This option is mainly relevant for future multi-locale support (for example, locale-specific grammar/capitalization differences). |
Examples:
date.weekday()
date.weekday(abbreviated=false, context=false)
Example return values:
Tuesday