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.

Date and time countdown

Featured Replies

Hi

I have a specific enddate and endtime. what I would like to do is show the time remaining in one field. For example if there are 2 days left is will say 2, however if there is less that 1 day left it should show the hours and minutes left. I can do this as separate calculations, but can't figure out a way to show this in the same field, since they result in different calculation types (date or time). Is there a way of doing this. or is it impossible due to the different calculation result formats?

Thanks

FM has functions called DateToText and TimeToText. Your final calc should be set to result in text. This is a very quick untested reply, but something like:

case(

EndDate < Status(CurrentDate), "the end date has passed",

EndDate = Status(CurrentDate), TimeToText(put your time calc here),

DateToText(put your date calc here) & " days"

)

Hope that helps a bit. smile.gif

cheers,

Wendy

  • Author

Thanks for the tip. Here is what worked for me:

TimeLeft=Case(EndDate > Status(CurrentDate), DaysLeft & " days", EndTimeEST > Status(CurrentTime),TimeToText(HoursLeft), "Ended")

  • Author

Here is a slightly modified version with more accurate output:

TimeLeft=Case(DaysLeft = "1", DaysLeft & " day", EndDate > Status(CurrentDate), DaysLeft & " days", EndTimeEST > Status(CurrentTime),TimeToText(HoursLeft), "Ended")

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.