The DateTime field generates a random date and time between a start and end.
fields:
- name: Created
type: DateTime
args:
start: "-10d"
end: "yesterday"
timezone: Australia/Perth
format: "%+"
- name: Deleted
type: DateTime
args:
start: "-10d"
end: "today"
timezone: Australia/Sydney
format: "%+"
constraints:
- type: GreaterThan
name: Created
- name: Refs
type: DateTime
args:
# This is how you reference another field.
start: "{{ refs['Choice'].raw }}"
end: "2010-01-01T00:00:00Z"
format: "%A, %B %e, %Y"
# You must define the fields that you want to reference.
- name: Choice
type: WeightedCategory
args:
choices:
- "2000-01-01T00:00:00Z"
- "1900-01-01T00:00:00Z"
| Created | Deleted | Refs | Choice |
| 2023-02-01T13:29:35.622865+08:00 | 2023-02-02T08:37:35.622865+11:00 | Saturday, August 12, 1911 | 1900-01-01T00:00:00Z |
| 2023-01-27T21:37:35.622865+08:00 | 2023-02-02T01:53:35.622865+11:00 | Saturday, July 26, 1986 | 1900-01-01T00:00:00Z |
| 2023-01-26T03:38:35.622865+08:00 | 2023-01-30T09:13:35.622865+11:00 | Wednesday, September 26, 2007 | 2000-01-01T00:00:00Z |
| Name | Type | Description | Default Value |
| start | string | The start date. This will accept a variety of inputs, details can be found here. | 2000-01-01T00:00:00Z |
| end | string | The end date. This will accept a variety of inputs, details can be found here. | 3000-01-01T00:00:00Z |
| timezone | string | The timezone to use. | UTC |
| format | string | The format to use. The complete list of specifiers can be found here. | "%+" |
| Name | Type | Description | Default Value |
| null_probability | float | The probability that the field will be null. | 0.0 |
| constraints | list | A list of constraints to apply to the field. | [] |
| Name | Description |
| GreaterThan | The value must be greater than the value of another field. |
| IfNull | The value must only be non-null if another field is null. |