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.

Featured Replies

Hi,

I have no idea where to put this post, so I'll put it here...

Does anyone know how to differentiate between English US and English UK date formatting, in a script or field calculation confused.gif.

Get( SystemLanguage ) just returns "English". Also, you don't appear to be able to set a field to (say) GetAsDate( "31/01/2005" ) and then retrieve it as "?" - the script interpreter always interprets it as 31st January.

Any ideas ?

Thanks,

Roger.

Filemaker uses system date formatting for display, to interpret data entry, and in the GetAsDate (text) and GetAsText (date) functions. System date formatting can be set independently of the language, so Get(SystemLanguage) cannot be relied upon to determine the current system date format.

If your system is set to use the d/m/y format, GetAsDate ( "31/01/2005" ) is a valid date entry. If you change your system to m/d/y, AND set the file to use current system settings, it will become invalid and return "?".

I tend to not rely on date formatting for anything critical, and use date functions instead to point at month and day explicitly.

You could determine the current system date format by examining the interpretation of a known date, although it will take some work. For example:

Let (

test = GetAsText ( Date ( 1 ; 2 ; 3456 ) ) ;

Case (

Left ( test ; 1 ) = 0 ;

// there is a leading zero for the first parameter

Left ( test ; 1 ) = 1 ;

// the first parameter is month with no leading zero

Left ( test ; 1 ) = 2 ;

// the first parameter is day with no leading zero

etc.

You can continue this to determine the rest of the formatting, incl. the separator and year's length.

  • Author

I thought a trivial mod to my date fields would be to have a default value (when the record is created) of "mm/dd/yyyy" (or "dd/mm/yyyy").

Turns out not to be trivial at all.

I tried using:

Left( GetAsText( Date( 1; 11; 2001 ) ) )

but it ALWAYS returns "11" in the first two characters irrespective of the current system format (presumably coz the file was created on a UK setting).

However, all the date fields show the date correctly when I switch system formats (they show up as either mm/dd or dd/mm).

Regards,

Baffled and Frustrated. mad.gifconfused.gifcrazy.gif

I'm afraid I don't quite follow. Do you still have a problem that needs a solution?

  • Author

No - I've decided not to bother.

Thanks for your help.

Roger.

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.