Skip to main content

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 format yyyy-MM-dd HH:mm:ss (Database Timestamp format)
    • "%1$tF %1$tT"

Ano Structure and Examples

        ...
mask <column> <rule-name>
format "%1$tF %1$tT"
random-datetime <from> <to> // [<from>, <to>]
...
  • <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)
  • random-datetime creates values of the format yyyy-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 the random-datetime keyword. This is the correct syntax.