Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculation based to time

Featured Replies

I thought this issues was going to be simple, but it turns out woking with time is something I've not been able to wrap my head around.

Can someone please tell me what is wrong with doing this.

If ( Get ( CurrentTime ) > "12:00:00 AM"; If ( Get ( CurrentTime ) < "03:00:00 AM" ; "TRUE" ; "FALSE" ) ; "FALSE" )

 

What I'm trying to do is find out if the the current time falls between two different times in the day.

I want to know if the current time is between 12am and 2:59 AM and return a True or False statement..

want to know if the current time is between 12am and 2:59 AM and return a True or False statement..

Use Time() to construct a value that you can safely compare to Get ( CurrentTime ):

Get ( CurrentTime ) > Time ( 0 ; 0 ; 0 ) and Get ( CurrentTime ) < Time ( 3 ; 0 ; 0 )

is True or False; no need to use If().

Note also that "True" and False" is merely text; the keywords True and False are written without quotes.

"12:00:00 AM" and "03:00:00 AM" aren't times, but strings.
Use Time ( 12 ; 0 ; 0 ) and Time ( 3 ; 0 ; 0 ) instead.

  • Author

Use Time() to construct a value that you can safely compare to Get ( CurrentTime ):

Get ( CurrentTime ) > Time ( 0 ; 0 ; 0 ) and Get ( CurrentTime ) < Time ( 3 ; 0 ; 0 )

is True or False; no need to use If().

How does it know the difference between AM an PM? Are we to use the 24 hour clock if needed.

Thanks for the help..

Are we to use the 24 hour clock if needed.

Yes.

  • Author

Perfect.. Looks like this is working.

Thanks four you help.

I want to know if the current time is between 12am and 2:59 AM and return a True or False statement..

Well, if the exact midnight can be included in the range, then you could simplify your test to:

Get ( CurrentTime ) < Time ( 3 ; 0 ; 0 )

or, if you prefer:

Get ( CurrentTime ) < 10800

as the current time will never be negative.

Edited by comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.