Problem with Date between DS 3.1 and 3.2

Run this in 3.1 and returns 1

is_valid_date(sysdate(),‘YYYY-MM-DD’);

Run this in 3.2 and returns 0

I then change this in 3.2 to

is_valid_date(sysdate(),‘YYYY.MM.DD’);

This then returns a 1 but want the string format to be in ‘YYYY-MM-DD’ on 3.2 as migrating code from 3.1 using the string ‘YYYY-MM-DD’

Is there something locally or a local change I need to do on 3.2 to get this to work?


phatz (BOB member since 2009-04-21)

is_valid_date(string, string)

is the function definition. As you provide a datetime (the sysdate() function output), DS has to convert it to a string first using the default format which is YYYY.MM.DD HH24:MI:SS. Obviously this format does not match the format YYYY-MM-DD, it has to be YYYY.MM.DD.


Werner Daehn :de: (BOB member since 2004-12-17)

Thanks but why does this work in 3.1 with no issues i.e. YYYY-MM-DD owrks in 3.1 but not in 3.2??


phatz (BOB member since 2009-04-21)

because 3.1 had a bug, it was not stringent enough in the test. Lot’s of people complained and said ‘2001-12-31’ does NOT match the format ‘YYYY.MM.DD’.


Werner Daehn :de: (BOB member since 2004-12-17)

lol thats what i wanted to understand. To fix this exported to ATl then did find and replace of YYYY-MM-DD to YYYY.MM.DD. Which has now fixed my problems.

Thanks


phatz (BOB member since 2009-04-21)