Random Date
Goal
Write mask
rule logic to
- generate random dates from an interval defined by
<from>
and<to>
properties - The
random-date
function generates values having standard formatYYYY-MM-DD
.%tF
Ano Structure and Examples
- Structure
- Update Example
- Create Example
...
mask <column> <rule-name>
format %tF
random-date <from> <to> // [<from>, <to>]
...
table birth_certificate
...
column date birth_date
...
...
task ... {
update birth_certificate
mask birth_date
format %tF
random-date 2020-01-01 2021-12-31
...
}
table birth_certificate
...
column date birth_date
...
...
task ... {
create birth_certificate minimum-rows 50
mask birth_date
format %tF
random-date 2020-01-01 2021-12-31
...
}
<from>
and<to>
values are included in the generated values.- Both are written using
YYYY-MM-DD
format
- Both are written using
random-date
creates values of the formatYYYY-MM-DD
, the%tF
will result in strings of this format.
For different formats, see Formats- Note the lack of double quotes
"
around the values after therandom-date
keyword. This is the correct syntax.