summaryrefslogtreecommitdiff
path: root/src/node_modules/chance/docs/finance/exp_month.md
blob: b77ad1ede746fd998d10bb4f137d315ab17140c3 (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
# exp_month

```js
// usage
chance.exp_month()
chance.exp_month({future: true})
```

Generate a random credit card expiration month.

```js
chance.exp_month();
=> '01'
```

Optionally specify that it must be a later month than the current month.

```js
chance.exp_month({future: true});
=> '10'
```

So if called in June, this would return a random month from July - Dec. If
called in October, would return November or December.

This because many credit card sandboxes require an expiration date later
than the current date so it's necessary when generating an expiration with the
current year to generate a month later than the current month.