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.

How do I make FMP5 'aware' of current date?

Featured Replies

Is it possible to have a single DB 'aware' of the current date without running a script or creating a record? I know how to do it by running scripts or creating a record but that's not what I need.

This is ultimately for a web based solution to generate a "Word of the Day" that is the same for every visitor for that day and then changes to the next one on the next day. The "Words of the Day" will be pre-loaded by a user via the web.

I want it to be totally automatic inside FMP but can't figure out how to.

Thanks in advance for any help.

Cael.

Added 2/19 ------

I played around with it and used a calculation status(currentdate) as an unstored calculation that gives me the date with no "/" so I can use it in another field which concatenates into an absolute URL.

LeftWords(DateToText(Status(CurrentDate)), 1) &

MiddleWords(DateToText(Status(CurrentDate)), 2, 1) &

RightWords(DateToText(Status(CurrentDate)), 1)

Today's date ends up like this: 2192001

I concatenated several user defined fields into one absolute URL pointed to an html file and am would like to use that field inside an [FMP-Include] tag. But I'm not sure if the date will reliably update automatically when called from the web inside the url.

[This message has been edited by CaelC (edited February 19, 2001).]

Instead of using a calculation status(currentdate) try using a calculation TODAY - it might give the date in the same format, but it updates at midnight.

Sorry, StevenB, but the TODAY function does not automatically update. The file must be closed and re-opened to recalculate TODAY, or a script must be run to force the recalcuation. FMI does not recommend using TODAY for solutions that are server based or hosted in Unlimited.

The preferred way is Status(CurrentDate) - this does automatically update.

  • Author

Thanks everyone for your input!

I am using Status(CurrentDate) for the reason previously mentioned.

But does anyone know for sure if it will update automatically when called from a format file in an instance such as this:

e.g. ---

<IMG SRC="[FMP-Field: Absolute_URL]">

Where I want the image to change daily and the field Date is a calculation that returns a text date and a path to the image for the day using this to determine the day:

LeftWords(DateToText(Status(CurrentDate)), 1) &

MiddleWords(DateToText(Status(CurrentDate)), 2, 1) &

RightWords(DateToText(Status(CurrentDate)), 1)

This gives me a date such as 2222001 which I then append a .gif to (with a field called gFileExtension) and put the rest of the absolute URL in using a field called gServer like so:

gServer & "/" & RightWords(DateToText(Status(CurrentDate)), 1) & "/"

& MonthName(Status(CurrentDate)) & "/"

& Date_Today & gFileExtension

This returns a result (an absolute path name to the image) in the format file essentially like this that should change on a day to day basis:

<IMG SRC="http://www.servername.com/February/2222001.gif">

So, ultimately does this reliably and accurately return the correct date from that original Status(CurrentDate) calculation?

Maybe at this point I should move the question over to the CDML forum?

Thanks for all the help so far and for any more that can be offered!

Cael.

quote:

Originally posted by CaelC:

Thanks everyone for your input!

I am using Status(CurrentDate) for the reason previously mentioned.

But does anyone know for sure if it will update automatically when called from a format file in an instance such as this:

If you make the calc UNSTORED, it should be recalculated everytime it is called.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

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.