Oct 17, 2022 08:58 AM
I need to be able to check and see if a certain time has passed in a formula field, and I don’t think I’m doing this right. My pseudocode is:
If now is past 10:30am today, then 1, otherwise 0
What would be the best way to go about this?
Oct 17, 2022 01:29 PM
IS_BEFORE(NOW(),Date)
Oct 17, 2022 01:57 PM
Thanks. How do I build the date & time desired?
How do I represent 10:30am on today?
Oct 19, 2022 06:22 AM
Bump… any thoughts?
Oct 19, 2022 11:49 AM
This is trickier than you might think. You need to convert the time to your local time zone. You also need to get the time without the date.
You should also know that NOW()
isn’t very accurate. It only updates periodically. In my experience it updates at best every few minutes, and at worst every few hours.
I’m also guessing that you want to do more with the formula result than just see a 1 or 0. Because someone could just look at a clock to figure that out.
IF(
SUM(
HOUR(
SET_TIMEZONE(
NOW(),
'America/New_York'
)
) * 100,
MINUTE({Session Start Time})
) < 1030,
1,
0
)
If you are in a timezone where your offset from GMT is not in full hours, you will also need to set the timezone for the minutes.
Oct 21, 2022 07:33 AM
Huh, well if Now() isn’t accurate - is there a better suggestion?