Date and time generators¶
Warning
The current page still doesn't have a translation for this language.
But you can help translating it: Contributing.
BirthdateGenerator¶
Generate a date of birth within configurable minimum and maximum ages.
Why: Use BirthdateGenerator when a person's date of birth must satisfy an inclusive age range at the run's reference date; use DateTimeGenerator for dates that are not age-derived.
Category: person.
Output: datetime.
1 | |
Parameters¶
min_age:int; Default1— Inclusive minimum age represented by the generated birthdate.max_age:int; Default100— Inclusive maximum age represented by the generated birthdate.
DateTimeGenerator¶
Generate fixed, ranged, weighted, offset, or reference-relative date-time values.
Why: Use DateTimeGenerator to model bounded, deterministic date-time requirements such as ranges, business-hour weighting, offsets, and dependencies on another field.
Category: core.
Output: datetime | int.
1 | |
Parameters¶
min:str | null; DefaultNone— Inclusive lower date-time bound parsed with input_format when supplied.max:str | null; DefaultNone— Inclusive upper date-time bound parsed with input_format when supplied.value:str | null; DefaultNone— Fixed date-time value; incompatible with random or offset modes.random:bool | null; DefaultFalse— Whether to draw a value from the configured bounded window.random_mode:bool | null; DefaultNone— Explicit alias for selecting random-window generation.input_format:str | null; DefaultNone— Python datetime format used to parse min, max, and value strings.hour_weights:list[float] | null; DefaultNone— Twenty-four relative weights controlling hour-of-day selection.minute_weights:list[float] | null; DefaultNone— Sixty relative weights controlling minute selection.second_weights:list[float] | null; DefaultNone— Sixty relative weights controlling second selection.month_weights:list[float] | null; DefaultNone— Twelve relative weights controlling month selection.weekday_weights:list[float] | null; DefaultNone— Seven relative weights controlling Monday-through-Sunday selection.dom_weights:list[float] | null; DefaultNone— Relative weights controlling valid days of a month.months:str | list[int] | null; DefaultNone— Allowed month numbers, ranges, or names used to constrain the window.months_exclude:str | list[int] | null; DefaultNone— Month numbers, ranges, or names removed from the allowed window.weekdays:str | list[int | str] | null; DefaultNone— Allowed weekday numbers or names.dom:str | list[int | str] | null; DefaultNone— Allowed day-of-month values; supports implementation-defined last-day notation.hours_preset:str | null; DefaultNone— Named hour window such as business hours.minute_granularity:int | null; DefaultNone— Positive minute step to which generated values are aligned.second_granularity:int | null; DefaultNone— Positive second step to which generated values are aligned.offset:str | null; DefaultNone— ISO 8601 duration or arithmetic offset applied to the base value.max_offset:str | null; DefaultNone— Maximum offset used when a bounded random offset is required.reference:str | null; DefaultNone— Field reference whose resolved date-time becomes the offset base.as_epoch:bool; DefaultFalse— Whether to return an integer epoch instead of a datetime value.epoch_unit:str; Defaultseconds— Epoch precision: seconds or milliseconds.