How to obtain age from date of birth?
#8

You'll have to split your string.
If your birthdate has this type of format: "21/02/1990"

You can do something like this:
PHP код:
test_function() {
    new 
string[] = "21/02/1990";

    new 
yearmonthday;
    new 
postmp[5];

    
strmid(tmpstring0, (pos strfind(string"/"true0)));
    
day strval(tmp);
    
    
strmid(tmpstringpos 1, (pos strfind(string"/"truepos 1)));
    
month strval(tmp);
    
    
strmid(tmpstringpos 1strlen(string));
    
year strval(tmp);

    
printf("%i/%i/%i"daymonthyear);

Reply


Messages In This Thread
How to obtain age from date of birth? - by Jose_grana - 11.08.2018, 23:44
Re: How to obtain age from date of birth? - by Jefff - 12.08.2018, 00:25
Re: How to obtain age from date of birth? - by Gammix - 12.08.2018, 01:13
Re: How to obtain age from date of birth? - by Jefff - 12.08.2018, 01:30
Re: How to obtain age from date of birth? - by Private200 - 12.08.2018, 02:18
Re: How to obtain age from date of birth? - by CaptainBoi - 12.08.2018, 03:38
Re: How to obtain age from date of birth? - by Jose_grana - 12.08.2018, 23:13
Re: How to obtain age from date of birth? - by Gammix - 13.08.2018, 01:08

Forum Jump:


Users browsing this thread: 1 Guest(s)