Navigation: Masks Reference >

DateTime Mask

 

 

 

DateTime Mask

The DateTime mask can mask dates and times in various formats. It also supports timezones.

The default mask is shown below; however, the field format must be specified in the Format tab before the mask can be used.

 

 

 

Date/Time Specification Type

 

Use this combo box to specify how randomized date/times are to be generated:

Offset

The combo box Offset setting will define the From and To, or Fixed, values to be specified as offsets from the original value.

The above form shows the default is plus or minus six months from the original date/time.

Click on the '...' button adjacent to each field to specify each value, as shown below:

 

Value

The combo box Value setting will define the From and To, or Fixed, values to be specified as explicit date/time values.

Click on the '...' button adjacent to each field to specify each value, as shown below:

The Time Zone field is optional. If it is not specified then the Java system default shall be assumed. The time zone in this input value is considered for any randomized date/time value range. Specifying a time zone does not mean that it shall appear in the generated masked value. The appearance of a time zone in a masked value is determined by the Output formatting string setting in the Format tab, described below.

Range

This specifies that the generated date/time shall be within the range specified by the From and To settings.

 

Fixed

This specifies that the generated date/time value shall be either a fixed date/time value or offset from the original value.

 

Format Tab
   

The Format tab defines how the original date/time value is to be parsed and how it should be formatted for output.

The output format defaults to same as input.

 

The radio buttons allow you specify from where this mask should source its format definition.

If you have many date/time fields that use the same format then it may be convenient to specify the format only once under the main Project Settings' Format tab and select this form's 'Use Date/Time format in Project Settings'.

DateTime Formatting Strings

 

 

Symbol

Description

Examples

 

G

Era

AD; Anno Domini; A

 

u

Year

2008; 08

 

y

Year of era

2008; 08

 

D

Year of era

2008; 08

 

M/L

Month of year

7; 07; Jul; July; J

 

d

Day of month

20

 

Q/q

Quarter of year

3; 03; Q3; 3rd quarter

 

Y

Week-based year

1996; 96

 

w

Week of week-based year

24

 

W

Week of month

4

 

E

Day of week

Wed; Wednesday; W

 

e/c

Localized day of week

2; 02; Tue; Tuesday; T

 

F

Week of month

3

 

a

AM-PM of day

AM

 

h

Clock hour of AM-PM (1-12)

12

 

K

Hour of AM-PM (0-11)

0

 

k

Clock hour of AM-PM (1-24)

1

 

H

Hour of day (0-23)

0

 

m

Minute of hour

30

 

s

Second of minute

55

 

S

Fraction of second

578

 

A

Milli of day

1234

 

n

Nano of second

123456789

 

N

Nano of day

989053298098433

 

V

Time zone ID

Europe/Budapest; +02:00

 

z

Time zone name

Pacific Standard Time; PST

 

O

Localized zone offset

GMT+10; GMT+10:00; UTC-08:00

 

X

Zone offset, 'Z' for zero

Z; -09; -0930; -09:30; -093015; -09:30:15

 

x

Zone offset

+0000; -09; -0930; -09:30; -093015

 

Z

Zone offset

+0000; -0900; -09:00

 

p

Pad next

1

 

'

Escape for text

 

 

''

Single quote

'

 

The formatting symbols are the same as those defined for Java 8 DateTimeFormatter class. Further information can be found at https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html. They can also be be found with an internet search on keywords 'java DateTimeFormatter api'.

Input

This format pattern describes how to parse the original date/time value.

Some common format patterns:

 

Format

Example

 

yyyy-MM-dd

2018-06-14

 

yyyy-MM-dd HH:mm:ss.SSS

2019-02-04 23:12:48.003

 

yyyy-MM-dd'T'HH:mm:ssXXX'['VV']'

2012-11-01T18:24:11+02:00[Europe/Budapest]

 

yyyy-MM-dd'T'HH:mm:ss.SSSVV

2019-04-01T12:30:59.123-07:00

 

yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'

2019-01-02T23:00:01.123456Z

 

Contains time zone

Select this check box if the format string contains time zone format specifiers.

 

Output

Same as input format

Select this checkbox if the masked value should be the same format as the original value. This is the default.

If this checkbox is not selected then you can specify an output format string in the text field below the checkbox.

 

Specifying an output format string that is different to the input format string

An example use case for specifying a different format string for output is to set some smaller resolution values to a fixed number, such as zero, or remove them altogether.

For instance, suppose that your file contains timestamps that have a fractional second component that are always zero such as '2018-06-23 18:45:53.000'. You could specify a format string to match the input values using yyyy-MM-dd HH:mm:ss.SSS. However, after randomization, FileMasker could produce values such as '2018-04-12 18:15:27.736'. Note that randomization is performed across the entire value including the fractional part. If you wanted to preserve the fractional part as zeros you could specify a format such as yyyy-MM-dd HH:mm:ss'.000' instead.

 

Test formatting of sample input value

This section of the Format tab lets you test whether the formatting string(s) specified are performing as expected.

Specify a sample value and click on the Test... button. FileMasker shall then attempt to parse this datetime value using the input and output format strings specified and display the value formatted for output.

 

Determinism
  

If the determinism option is set to Deterministic then all occurrences of a specific date/time shall be masked with the same value; however, these must have the exact same resolution and values.

For example, if an original datetime value was 2018-06-23 18:45:53 and the masked value is 2018-02-16 09:22:31  then the same masked value shall be used wherever exactly 2018-06-23 18:45:53 appears.

Please note that values of a different resolution will be masked completely differently. For example, the above value is in 'seconds' resolution. If a value of 'day' resolution such as 2018-06-23 appears then the masked value will not match the date part of the same date that contains additional time resolution. E.g. the masked value could be '2018-11-27 '.

Therefore, the entire datetime value is considered as a distinct value and individual components, such as year, month, etc, shall not be considered separately for deterministic masking.

To summarize by example: 

 

Original

Masked

Notes

 

2018-06-23 18:45:53

2018-02-16 09:22:31

The masked yyyy-MM-dd values are different for the same original yyyy-MM-dd because the original values are considered in their entirety when generating masked values.
 

 

2018-06-23

2018-11-27

 

Other Considerations
  

* The FileMasker DateTime mask does not synchronize with masked values produced by the DataVeil DateTime mask; however, the Randomize DateTime mask does.

 

 

 

 

 

 

 

 

Copyright © 2019-2021 DataVeil Technologies Pty Ltd