data validation with a date dd//mm/yy 10 character - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

data validation with a date dd//mm/yy 10 character

bazzanobazzano Posts: 15Member
I need to use fgets() function and check for character validation for a calender date in the format of dd//mmm/yy. Does anyone know how to do that im finding this difficult.


The user needs to be able to enter the date as dd//mm/yy all on the one line using fgets() and checking for 10 characters validility.


Thanks

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : I need to use fgets() function and check for character validation for a calender date in the format of dd//mmm/yy. Does anyone know how to do that im finding this difficult.
    :
    :
    : The user needs to be able to enter the date as dd//mm/yy all on the one line using fgets() and checking for 10 characters validility.
    :
    :
    : Thanks
    :

    about the best you can do is split the string into its three parts -- month, day and year then validate each of these. For day check that it is not greater than the number of days in the given month. month check just simply between 1 and 12. year -- check that it is two digits, but you really should allow 4 digits to include the century.


Sign In or Register to comment.