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.
Juggernaut

What's wrong with this Timestamp Calc?

Featured Replies

I am trying to find the difference between the creation timestamp and the current timestamp, then if the difference is more then 20 days to set that record to inactive.

Timediff :[color:blue]Calc, unstored = Let ([

time = Get ( CurrentTimeStamp ) - Timefirstshark ;

days = Div ( time ; 24 * 60 * 60 );

time = Mod (time; 24 * 60 * 60 )

];

days & ":" & Hour ( time ) & ":" & Minute ( time ) & ":" & Seconds ( time ))

Active:[color:blue] Calc, unstored = Case (Timediff > "20:0:0:0" ; "No" ; "Yes" )

It seems to work at first, but then for some reason it thinks 10:0:0:0 is less then, but 4:0:0:0 is greater?

There are many approaches. This produces a 0 if it has lapsed and a 1 if not. This is kinda cool (using boolean 1/0) because you can then format your layouts as number (boolean display of [color:green]Lapsed if FALSE 0 and [color:green]Active if TRUE 1).

Let ( lapse = 86400 * 20 ; TimeFirstShark + lapse < Get ( CurrentTimeStamp ) )

The calculation must be Unstored in Storage Options. If you have your heart set on hard-coding in the field, then use Case() or If() like so:

Let ( lapse = 86400 * 20 ; If ( TimeFirstShark + lapse < Get ( CurrentTimeStamp ); "Active" ; "Expired" ) )

I took liberties of wasting an evaluation for clarity because down the road you may wonder what 1,728,000 meant and this clearly indicates 20 exact days. Using 1/0 allows changing what you CALL the result simply by displaying it at the field level. You may want to call it Yes/No in one location, Active/Expired in another and even Current/Lapsed in another. It also easily allows filtering and control of display for portals. :wink2:

LaRetta

  • Author

Great LaRetta,

Made one small mod:

TimeFirstShark + lapse [color:red]> Get ( CurrentTimeStamp )

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.