Date masking policy (predefined)

The predefined Date policy masks a selected column by offsetting a date or time value by a configured amount.

The Date policy adds positive offset values to an input date or time. Each offset unit (years, months, weeks, days, hours, minutes, seconds) is applied additively to the input date. The output is returned in the same format as the input.

All offsets are positive — the output date is always later than the input date. All offset values default to 0 if not specified.

Date patterns follow Java SimpleDateFormat conventions. The input must match the configured Date Pattern exactly.

Date pattern symbols

The following date pattern symbols are valid for the Date policy.

Table 1. Common date pattern symbols
Symbol Meaning Example
yyyy 4-digit year 2026
MM 2-digit month 03 (March)
dd 2-digit day 21
HH Hour (24-hour) 14
mm Minutes 04
ss Seconds 21

Configuration options

Use the following options to configure the Date policy.

Date Pattern (required)

The pattern that describes the format of the input date value. The output uses the same pattern.

Table 2. Example date patterns
Input example Pattern
03/21/2026 10:04:21 MM/dd/yyyy HH:mm:ss
2026-03-21 yyyy-MM-dd
21-03-2026 10:04 dd-MM-yyyy HH:mm
2026/03/21 10:04:21 yyyy/MM/dd HH:mm:ss
Day Offset (optional)
Number of days to add to the input date. Defaults to 0.
Week Offset (optional)
Number of weeks to add to the input date (1 week = 7 days). Defaults to 0.
Month Offset (optional)

Number of months to add to the input date. Defaults to 0.

Note: When adding months to a date whose day does not exist in the target month (for example, January 31 + 1 month), the result is adjusted to the last valid day of that month (for example, February 28 or 29).
Year Offset (optional)

Number of years to add to the input date. Defaults to 0.

Note: Adding years to February 29 in a leap year adjusts to February 28 in a non-leap target year.
Hour Offset (optional)
Number of hours to add to the input time. Defaults to 0. Overflows carry into the date (for example, 23:00 + 2 hours = 01:00 the next day).
Minute Offset (optional)
Number of minutes to add to the input time. Defaults to 0. Overflows carry into hours.
Second Offset (optional)
Number of seconds to add to the input time. Defaults to 0. Overflows carry into minutes.

Processing order

All offsets are applied in the following order:

  1. Years
  2. Months
  3. Weeks
  4. Days
  5. Hours
  6. Minutes
  7. Seconds

API configuration (policy_metadata)

Use the following keys to configure the Date policy through the API.

Table 3. Date policy_metadata fields
Key UI field Type Description
pattern Date Pattern String Pattern string describing the input date format.
dayOffset Day Offset String Number of days to add. Use "0" or omit for none.
weekOffset Week Offset String Number of weeks to add. Use "0" or omit for none.
monthOffset Month Offset String Number of months to add. Use "0" or omit for none.
yearOffset Year Offset String Number of years to add. Use "0" or omit for none.
hourOffset Hour Offset String Number of hours to add. Use "0" or omit for none.
minuteOffset Minute Offset String Number of minutes to add. Use "0" or omit for none.
secondOffset Second Offset String Number of seconds to add. Use "0" or omit for none.
{
  "pattern": "MM/dd/yyyy HH:mm:ss",
  "dayOffset": "1",
  "hourOffset": "2",
  "weekOffset": "3",
  "yearOffset": "4",
  "monthOffset": "5",
  "minuteOffset": "6",
  "secondOffset": "8"
}

Known limitations

The Date policy has the following limitations.

Offsets are positive only
All offset values add to the input date. There is no way to offset backwards to an earlier date. If a negative (past) offset is required, a custom transformation is needed.
Month-end adjustment may produce unexpected dates
When adding months to a date whose day does not exist in the target month (for example, October 31 + 1 month), the result is silently adjusted to the last valid day of that month (November 30). This adjustment is not configurable.
Leap year adjustment for February 29
Adding years to a February 29 input adjusts to February 28 in non-leap target years. This adjustment is not configurable.
Input must exactly match the configured Date Pattern
If the input value does not match the Date Pattern, the policy raises an error for that row. Ensure the Date Pattern matches all values in the source column, including any separators and time components.
Time overflow carries into the date
Hour, minute, and second offsets that push past midnight roll into the next calendar day. This is expected behavior but should be considered when the date portion of the output is significant.