Random Datetime
Goal
Write mask
rule logic to
- generate random datetimes from an interval defined by
<from>
and<to>
properties - The
random-datetime
function generates values having formatyyyy-MM-dd HH:mm:ss
(Database Timestamp format)"%1$tF %1$tT"
Ano Structure and Examples
- Structure
- Update Example
- Create Example
...
mask <column> <rule-name>
format "%1$tF %1$tT"
random-datetime <from> <to> // [<from>, <to>]
...
table birth_certificate
...
column datetime created
...
...
task ... {
update birth_certificate
mask created
format "%1$tF %1$tT"
random-datetime 2020-01-01 07:00:00 2020-01-15 23:59:59
...
}
table birth_certificate
...
column datetime created
...
...
task ... {
create birth_certificate minimum-rows 50
mask created
format "%1$tF %1$tT"
random-datetime 2020-01-01 07:00:00 2020-01-15 23:59:59
...
}
<from>
and<to>
values are included in the generated values.- Both are written using the format
yyyy-MM-dd HH:mm:ss
(Database Timestamp format)
- Both are written using the format
random-datetime
creates values of the formatyyyy-MM-dd HH:mm:ss
, the"%1$tF %1$tT"
will result in strings of this format.
For different formats, see Formats- Note the lack of double quotes
"
around the values after therandom-datetime
keyword. This is the correct syntax.