TZINWINDOW
TRUE if the local time-of-day falls in [start,end); days_mask is 7 chars Sun..Sat
Try it
When to use it
When should I use TZINWINDOW instead of comparing TZPART results manually?
Use TZINWINDOW when you need to check whether a moment falls within a time-of-day range, especially when you also want to restrict to certain days of the week — it handles both checks in a single call.
What does the days_mask parameter do, and what happens if I omit it?
days_mask is a 7-character string 'SMTWTFS' where _ excludes that weekday; omitting it means all days are included, so only the time-of-day window is checked.
What happens if start_local is greater than end_local?
TZINWINDOW evaluates the interval as given — since it checks local time-of-day against [start_local, end_local), passing a start that is larger than end will result in FALSE for most times because the range is effectively empty or wraps unexpectedly.
Use cases
Check if a shipment timestamp is within a warehouse receiving window
Determine if a trade timestamp falls within market open hours
Used in
operations · logistics · finance
Syntax
TZINWINDOW(zoned,start_local,end_local,[days_mask])