summaryrefslogtreecommitdiff
path: root/src/node_modules/chance/docs/time/year.md
blob: 4ef452781a8164d126836f505a0f3b54764d90d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# year

```js
// usage
chance.year()
chance.year({min: 1900, max: 2100})
```

Generate a random year

```js
chance.year();
=> '2053'
```

By default, min is the current year and max is 100 years greater than min.

This is returned as a string. If for some reason you need it numeric, just
parse it:

```js
parseInt(chance.year());
=> 2042
```

Optionally specify min, max, or both to limit the range.

```js
chance.year({min: 1900, max: 2100});
=> '1983'
```