|
-
Sep 23rd, 2001, 11:26 AM
#1
Thread Starter
Addicted Member
Calculating the age of a person...
Hi all!
I have a table (mySQL) which is filled with member-information. One field in this table is the birthdate of a person in yyyy-mm-dd format. I converted this date to a unix-timestamp and calculated the difference to the timestamp of today.
But there's a problem...
A member who had been born before the 1st of January in 1970 has no age... 
Infact PHP doesn't allow a timestamp to be negative... So what do I have to do? Should I forbid persons born before 1970 to become members??
The algorithm should be programmed in PHP (4).
Thanks in advance,
dmr.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|