RandomDateTimeRange / New Layer
Create a new column with random datetime values within a specified range. Similar to pandas date_range() with random sampling. Generates datetime values between Start
and End
at specified IntervalValue
steps. Timezone-naive by default.
Format
stringFormat pattern for parsing Start
and End
dates. Uses strftime syntax. Examples:
- %Y-%m-%d (e.g., 2024-01-31)
- %Y-%m-%d %H:%M:%S (e.g., 2024-01-31 15:30:00)
- %d/%m/%Y (e.g., 31/01/2024)
Start
stringStart datetime (Start
) of the range. Must match specified Format
. Example: if format is %Y-%m-%d, then 2024-01-01
End
stringEnd datetime (End
) of the range. Must match specified Format
and be later than Start
. Example: if format is %Y-%m-%d, then 2024-12-31
TimeUnit
enumPrecision of datetime values, affecting storage and computation granularity
Date-only values, no time component
Nanosecond precision (10^-9 seconds) - highest precision available
Microsecond precision (10^-6 seconds) - common for high-resolution timestamps
Millisecond precision (10^-3 seconds) - typical for most applications
Closed
enumControls inclusion/exclusion of boundary dates, similar to pandas interval notation [start, end] or (start, end).
Include start, exclude end [start, end) - like range() in Python
Exclude start, include end (start, end] - useful for end-of-period calculations
Include both start and end [start, end] - for inclusive ranges
Exclude both start and end (start, end) - for strictly interior points
IntervalValue
stringTime step size as a duration string. Determines the possible values for random selection. Examples:
- 1d (daily steps)
- 1h30m (1.5 hour steps)
- 1mo (monthly steps)
- 1y (yearly steps)
Available units: ns (nanosecond), us (microsecond), ms (millisecond), s (second), m (minute), h (hour), d (day), w (week), mo (month), q (quarter), y (year)
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.