With some help from here, I found the following SQL query that finds the start of the first coming Friday:
postgres=# select date_trunc('day', localtimestamp(0) + interval '1 day' * ( select ( 12 - extract(isodow from date_trunc('hour', localtimestamp(0)))::int ) % 7 as temp )) as next_friday;
next_friday
---------------------
2024-01-05 00:00:00
(1 row)
If you want 18:00h / 6PM:
postgres=# select date_trunc('day', localtimestamp(0) + interval '1 day' * ( select ( 12 - extract(isodow from date_trunc('hour', localtimestamp(0)))::int ) % 7 as temp )) + interval '18 hour' as next_friday;
next_friday
---------------------
2024-01-05 18:00:00
(1 row)
This is standard Postgres SQL time calculations. Postgres is the database system that ClearPass uses under the hood.
------------------------------
Herman Robers
------------------------
If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check
https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.
In case your problem is solved, please invest the time to post a follow-up with the information on how you solved it. Others can benefit from that.
------------------------------
Original Message:
Sent: Dec 26, 2023 02:21 PM
From: Shachar
Subject: ClearPass Time Source - Next Monday
Thanks for sharing the solution.
What would I need to change if i would like to get "Next Friday"?
Original Message:
Sent: Sep 10, 2018 02:00 PM
From: LmenD
Subject: ClearPass Time Source - Next Monday
If anyone was interested in the solution for their own environment, here's what I received from TAC.
select date_trunc('day', localtimestamp(0) + interval '1 day' * (select 8 - extract(isodow from date_trunc('hour', localtimestamp(0))) as temp)) as next_monday