KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Computing new dates
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: November 20, 2001

Computing dates from scratch is a very easy task. You usually assemble a date in the following manner:

Date(String(MyMonth)+"/"+String(MyDay)+"/"+String(MyYear))

This works as long as you run your database on a system that uses the date format MM/DD/YY. If you run your database on a system that uses the DD/MM/YY format, it will obviously cease to work properly.

To avoid this problem, you may use the following code sample:

Add to Date (!01/01/1900!; MyYear-1900; MyMonth-1; MyDay-1)