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.

SetField, Get(CurrentDate), and date formatting question

Featured Replies

I really thought this was a FileMaker no-brainer but it's turning out to be a Richard no-brain. :S

I have a script step in my runtime solution--that I'm coding on a Mac--that sets the current date for a Date field:

SetField [WEBSITE::LastVisitedDate__lxd; Get(CurrentDate)]

The Date field, in the Inspector, is set to "As entered" and File Options [Text] is set to "Always use current system settings." The computer's Date & Time Preference is set in Language and Text > Formats as Custom with the "Short" date format set to 01-05-2012.

The problem is that when the script step runs it inputs the date as 2/12/2012 instead of 02-12-2012. However, if I click on the date field's drop-down calendar icon and change the date, it comes up as it should in the preferred format, 02-12-2012.

This happens both in the runtime and master file.

I read in the Help file that "The format of the result of this function varies based on the date format that was in use when the database file was created." On the surface, that doesn't make sense since if you decide to change date formats after creating the file then you're stuck.

What am I missing here?

TIA for your help!

Have you tried changing the date format in the Inspector? I changed mine to 01/05/2012 and then changed the numeric separator to a hyphen and added leading zeros to single digit days and months.

if you decide to change date formats after creating the file then you're stuck.

If you decide to change date formats after creating the file, you must create a clone of the file and import your data into the clone.

Usually, setting a file to "Always use current system settings" is sufficient - but there are a few quirks, such as the one you describe.

  • Author

Steigrafx: I thought of that but since it's a runtime where I want the file to conform to the end-user's computer-set preferences; I'm trying to keep a hands-off approach to setting preferences as much as possible, including what's in the Inspector, since users won't have access to it to set their preferred formats.

Comment: I see a potential headache here if a user were to hose their solution in some way and I'd have to come to the rescue by importing their data into a replacement runtime; I'd have to create a clone of the master file with their format settings, I guess?

Being a developer is soooooooo fun.

A clone inherits the formats of the system under which it is first opened. There is no shortage of potential headaches. :hmm:

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.