Date handling functions
You can mask dates.
Function | Random masking | Consistent masking | Format-preserving encryption | Input data validation | Details |
---|---|---|---|---|---|
Date variance | Yes | No | No | No | You can use the tPatternMasking component to mask dates in a bijective manner. However, the variation in days is not guaranteed. |
Keep year and set day and month to 01/01 | No | Yes | No | No |
- |
Date variance
This function varies the input date by the number of days specified as an extra parameter.
If the input date is null, then the function returns the current date.
Option | Description |
---|---|
Extra parameter |
This function requires an extra parameter.
The extra parameter must be a number of days. If the extra parameter is 0 or null or if it is not a number, then the parameter is replaced with 31. For example, if the input date is 05-11-2016, then the generated date is randomly selected between 04-10-2016 (31 days before the input date) and 06-12-2016 (31 days after the input date). |
In the first example, the extra parameter is "0". Then, the function replaces this value with 31. The generated date, 07-07-2018, is randomly selected between 01-06-2018 (31 days before the input date) and 02-08-2018 (31 days after the input date).
In the first example, the extra parameter is "4". The generated date, 01-07-2018, is randomly selected between 29-06-2018 (4 days before the input date) and 06-08-2018 (4 days after the input date).
Input value | Extra parameter | Example of a masked value |
---|---|---|
02-07-2018 | "0" | 07-07-2018 |
02-07-2018 | "4" | 01-07-2018 |
Keep year and set day and month to 01/01
This sets the month and day of the input date to January, 1 but does not change the year.
If the input date is null, the function returns January, 1 of the current year, for example 01-01-2019.
This function requires no extra parameter.
The function returns January, 1 of the current year.
Input value | Example of a masked value |
---|---|
24-12-2019 | 01-01-2019 |