5 Replies Latest reply on Jan 15, 2019 9:16 AM by Steve O'Leary

# \$\DATE\$ calculation but with a specific time?

Share:|

I know that I can do this to go back 7 days:

'Submit Date' > (\$\DATE\$ - (7*24*60*60))

But I want to go back to "5:00:00 AM" on that day. How can I accomplish this?

• ###### 1. Re: \$\DATE\$ calculation but with a specific time?

I haven't tried it, but today + 5 hours should do it.

'Submit Date' > (\$\DATE\$ + (5*60*60))

or did you mean 7 days back and then there 5AM

'Submit Date' > (\$\DATE\$ - (7*24*60*60) + (5*60*60)) (Two calculations for better readability)

2 of 2 people found this helpful
• ###### 2. Re: \$\DATE\$ calculation but with a specific time?

Thanks. I'll try that.

So then today at 5 am would be something like "\$\DATE\$ + (5*60*60)" ?

• ###### 3. Re: \$\DATE\$ calculation but with a specific time?

Correct, 5hour × 60 min x 60 sec

• ###### 4. Re: \$\DATE\$ calculation but with a specific time?

DATE is simply a date field, no? Meaning it is stored as the number of days from 1970 (or something). If you are trying to go back to 5:00 AM, you should probably change to a Date/Time field. Then do the following:

1. +Z_Temp_CharacterField = (\$\DATE\$ - (7*24*60*60))

If DATE = 2019/01/15 then this character field should be set to 2019/01/08

2. +Z_Temp_DateTimeField = +Z_Temp_CharacterField + "05:00:00 AM"

So this should set DateTime to 2019/01/08 05:00:00 AM.

You may have to play around with your date (and time) formats to match what you use, but this should give you the gist.

• ###### 5. Re: \$\DATE\$ calculation but with a specific time?

Nevermind. Just confirmed that what Stefan wrote,  'Submit Date' > (\$\DATE\$ - (7*24*60*60) + (5*60*60)), works.