Skip to content

Latest commit

 

History

History
87 lines (69 loc) · 1.74 KB

random-time.mdx

File metadata and controls

87 lines (69 loc) · 1.74 KB
sidebar_position sidebar_label
4
Random Time

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

Random Time

:::tip Goal Write mask rule logic to

  • generate random times from an interval defined by <from> and <to> properties
  • The random-time function generates values having standard format "HH:mm:ss" (24-hour time format)
    • %tT

:::

Ano Structure and Examples

<Tabs defaultValue="structure" values={[ { label: 'Structure', value: 'structure' }, { label: 'Update Example', value: 'update' }, { label: 'Create Example', value: 'create' }, ]}

        ...
        mask <column> <rule-name>
            format %tT
            random-time <from> <to>      // [<from>, <to>]
        ...
table birth_certificate
    ...
  	column time birth_time
    ...
...
task ... {
	  update birth_certificate
		    mask birth_time
			      format %tT
			      random-time 00:00:00 23:59:59
        ...
}
table birth_certificate
    ...
  	column time birth_time
    ...
...
task ... {
	  create birth_certificate minimum-rows 50
		    mask birth_time
			      format %tT
			      random-time 00:00:00 23:59:59
        ...
}
  • <from> and <to> values are included in the generated values.
    • Both are written using the format "HH:mm:ss" (24-hour time format)
  • random-time creates values of the format HH:mm:ss, the %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-time keyword. This is the correct syntax.