Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dates and nuts
Message
From
14/09/2001 11:04:44
 
 
To
14/09/2001 10:34:25
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00556454
Message ID:
00556500
Views:
14
>>I need to validate web data which is by default type string. The fields which are most difficult to validate are DATE type. I have written code over the years to validate such strings but I never felt satisfied that I was thorough. does anyone have any code suggestions for this validation. what I am interested in is strictly a valid date.
>>
>>9/14/01
>>09/14/01
>>09/14/2001
>>01/14/09
>>09-14-01
>>09-14-2001
>>09.14.01
>>
>>and on and on
>>
>>Thanks
>>
>>Glenn
>
>Probably not what you want to hear, but here it is anyway.
>
>The simplest (but maybe not the most comprehensive) answer that I have is to use the VFP CTOD() function. It will certainly handle all of the variations that you have given as examples.

It will handle all variations, but may give incorrect results for the date stated as 01/14/09. In VFP I don't see a date format 'yy/dd/mm', if you pass it as is (with Set Date American), it will return {01/14/2009}.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform