>I have searched for something like isdate() or similar function, but can't find any.
>So, how can I find if xValue is a valid date?
>I'm trying to write a function that translates any valid date to an easily read date value in Spanish, like 3/Ene/2004
>So far I managed to make the default value of a field = to convertdate(date()), but what if the user wants to write a different date and it happens that is not a valid date? Also I want the function to check for this, instead of having to write code for every date field in my application. Yes, it is in a very advanced state, and I thought of this just now.
I will assume DMY date format.
? not empty(ctod("11/13/2004"))
...will return .F., since there is no month #13. For a valid date, this will return .T.
If you use VFP 6 or later, you may also have to temporarily SET STRICTDATE to a lower value.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)