DateTime Mask

The DateTime mask provides support for DBMS temporal data types.

The DateTime mask can be selected from the Masking panel's mask combo box only when a column of temporal data type is selected, such as DATE, TIME, etc. In other words, the DateTime mask will be disabled for column data types that are not specifically temporal types such as VARCHAR and INTEGER..


The example screen capture above shows that dates in the column 'dob'  shall be randomized within plus or minus six months of their original date values.

Also note that the resolution is set to 'Day'. The resolution specifies the whole unit of the generated value. This means that smaller resolutions shall not be randomized. In this example it means that randomized values for hours, minutes, seconds shall not be generated. The resolution is a DataVeil column-level setting (not per-mask) and so it cannot be changed from within the mask. Please see the 'Date/Time Column Settings' section below.

To specify date/time values or offsets in the above panel, click on the adjacent '...' button. The 'Specify a Date/Time Offset' dialog shall appear, as shown below.

Please also note that the first field (sometimes overlooked by users and indicated by the blue arrow below) is a combo box that specifies whether the offset should be subtracted ('-') or added ('+') in masking value calculation.


The units shown in this panel are for the user's convenience. For example, specifying 6 in the Months field is exactly the same as specifying 180 in the Days field.
Note: When specifying offsets, DataVeil shall calculate the number of days on the basis of 30 days per month.



When using the Random specification, you can specify Offset or Value in the combo boxes for both From and To, and you can also use a mix of Offset and Value. For example, you could specify an Offset in the From field, and an absolute Value in the To field. At run time, DataVeil shall consider the lower limit the smaller of the (original value + Offset) and Value, and the upper limit as the larger of the two and then choose a randomized date/time value within that range.


When using the Fixed specification, if you have chosen Offset in the combo box then the masked value shall be the original date/time adjusted by the fixed offset. If you have chosen Value in the combo box then every row shall be masked with the same fixed value that you have specified.


Combo Box options


When you select 'Offset' from the combo box, the masking value that you specify after clicking on the adjacent '...' button shall be an offset relative to each original value.


When you select 'Value' from the combo box, the masking value that you specify after clicking on the adjacent '...' button shall be an absolute date/time value. The original value shall have no bearing on the generation of the masked date/time value.


Date/Time Column Settings


The values shown in the 'Current Column Settings' section of the DateTime mask dialog are read-only because they apply to the columnand therefore potentially other DateTime masks; not just the current mask.

These values can be set in the Date/Time tab that is in the column's Masking tab as shown below.

This Date/Time tab appears only when a column of temporal type is selected, such as the 'dob' column shown below:


Time Zones

If a time zone is present in the data type then it shall be preserved.


Masking Consistently Across Different DBMS Types

When used in Deterministic mode, this mask will generate the same masked values for the same original values that are contained in data types that have the exact same definitions (including precision) shall be masked consistently within the same DBMS type (i.e. MySQL, Oracle, SQL Server).

For example, a datetime value in an Oracle column will be masked to the same value as another occurrence of the same original value in another Oracle column provided that both columns have the same data definition including the same precision.

However, a datetime value in an Oracle column may not be masked to the same value as another occurrence of the same original value in another DBMS type, such as SQL Server or MySQL, because the internal representations of datetime types may be different across different DBMS types.

If masking date/times consistently across different DBMS types is essential then use the Randomize DateTime mask instead as it can mask date/time values consistently across different DBMS types.