If you only need the day of the month, this should do it -
q: (current date + it * day) whose (day_of_week of it = Monday) of integers in (1,7)
A: Mon, 03 Apr 2023
T: 0.363 ms
With that day range, you should get the next Monday (but not today, if today is a Monday). If you want to include today, then change the day range from (1, 7) to (0, 6).
If you’re using this for a maintenance window, and need to set a specific time of day, you can do that using either the client’s local time zone, or UTC time, as
q: (it & "04:30:00" as local zoned time_of_day) of (current date + it * day) whose (day_of_week of it = Monday) of integers in (1,7)
A: Mon, 03 Apr 2023 04:30:00 -0500
T: 7.360 ms
I: plural time
(Monday, 04:30 UTC will occur for me on Sunday at 23:30 local time)
q: (it & "04:30:00" as universal zoned time_of_day) of (current date + it * day) whose (day_of_week of it = Monday) of integers in (1,7)
A: Sun, 02 Apr 2023 23:30:00 -0500
T: 7.313 ms
I: plural time
I also went down a path with a pretty bad edge case. Considering you might want a maintenance window to start at a specific time on either this week or next (if Today matches your day), I started by expanding the day range to (0, 7) potentially checking both today and next week, and taking the lesser of the two that is greater than “now”.
q: ((it & "04:30:00" as local zoned time_of_day) of (current date + it * day) whose (day_of_week of it = Tuesday) of integers in (1,7)) whose ( it > now)
A: Tue, 04 Apr 2023 04:30:00 -0500
T: 7.260 ms
I: plural time
The problem with that comes when the time arrives. When the current time is “Tue, 04 Apr 2023 04:20:00 -0500”, the result will be the next instance of 04:30 (at A: Tue, 28 Mar 2023 04:30:00 -0500) - but once 4:30 comes around, that time becomes less than “now” and the result changes to “Tue, 04 Apr 2023 04:30:00 -0500”. If you’re going to compare that time to “now” to return a True/False value, you could give a range like “now is less than four hours after the given start time” as in
q: minimum of ((it & "04:30:00" as local zoned time_of_day) of (current date + it * day) whose (day_of_week of it = Tuesday) of integers in (0,7)) whose ( it < now + 4 * hour)
A: Tue, 28 Mar 2023 04:30:00 -0500