I would like to set the above condition for the Explorer filter, because I want to display only the entries that met a certain time value, i.e., after 11:00 am Eastern Time, and not showing every entries including pre-market data, etc.
My issue is this expression sometimes returns incorrect results (although it returns correct results most of the time), for example, if TimeUnit = 8 and interval () is 5 minute, which is 5x60= 300, and 8x300=2400. So if the current time Now(4) is, say, 82100, then 82100 - 2400 = 79700, which is wrong, because there is no 97 minute in the clock. I tried:
DateTimeAdd() will correctly add / subtract the required intervals that you need.
Later if you dont need the date part of it, then you could just extract the time component and use it for your calculations.
Your usage of DateTimeDiff() is incorrect. Both arguments have to be of DateTime() type.
Same applies for the calculation you are trying to do with TimeNum(). Check the manual again if you want to do the math yourself.