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.

CDML Century Date Formats 19xx vs. 20xx

Featured Replies

Hi, folks! I made a form in which users submit dates et. al. via the web. I was confused when I saw the year showing up as 1903 for data submitted while my FileMaker creation/modification dates were showing 2003. After a little searching, I found this 2000 / 2001 thread mentioning something similar. Garry mentions JavaScript for his solution, but on a scale of 0-10, I am a 0.01 wrt JS -- even toward understanding his script. A search at FMP, Inc. website told me (although I missed it the first time around but caught it on a web page find) that FMP's "two-digit year date Interpretation Algorithm" only works within FMP itself and not for Web Companion (article below).

Is JavaScript still the way to go, or has anyone found another route?

If it's JS, can anyone copy/paste a script for me that will work for U.S. 9/14/03 that will covert 03 to 2003?

How do I create an INPUT for a JS variable and then put a resulting calc into my FMP field?

Thanxalot! --ST

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

YEAR 2000 ARTICLE: http://www.filemaker.com/ti/108216.html (CLIPPING BELOW)

Q: How does FileMaker Pro handle two-digit year dates?

A: As described in the Readiness Disclosure, in FileMaker Pro 3.0 through 6.0, two-digit year dates are handled differently depending on whether they are entered or edited directly in a date field, or entered from some other source (imported, input through the Web Companion or FileMaker Mobile, etc.). If you enter a two-digit year directly while editing a date field, FileMaker Pro 3.0 through 6.0 applies an "Interpretation Algorithm" to pick the century for the year. If the date is entered from some other source, FileMaker Pro 3.0 through 6.0 converts the two-digit year to "19xx" (not the current century, but actually "19xx") .

Steve,

I don't have a chance to test or even think about this too far, but could there be something involving a FileMaker calculation and IF? You'd have to split up the entry into a couple fields (month/date + year) and it would depend on what MIGHT be entered, but eg: if the YEAR number entered (02, 03, etc) is <60, add to 2000. If the number is greater then 60 (97, 98, etc), add to 1900. The resulting calculation, combined with the month/date field in a second calculation, could be then construed as a date?

Sounds too complicated, but maybe it'll suggest something to those with greater capabilities.

Ernie

Here is one that may work for you.

<script>

function fixdate()

{

sDate = document.myform.mydate.value.split("/")

if (sDate[2] < 2000)

{

sDate[2] = (sDate[2] - 0) + 2000 ;

document.myform.mydate.value = sDate.join("/") ;

} ;

document.myform.submit() ;

} ;

</script>

</head>

<body>

<form name="myform" action="FMPro" method="POST" onsubmit="Javascript:fixdate(); return false">

<input .....

Date (e.g. 1/13/03): <input type="text" name="mydate" value="">

....

All the best.

Garry

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.