Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4668 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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.

Posted

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.

Posted

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.

This topic is 4668 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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