Jump to content

time stamp from dropdowns?


Zaper Gallis

Recommended Posts

Ok, i can't find this anywhere. I have a script that uses 3 drop down menus, one for day, month, and year. I can save them to mysql and use then to display a date. But i don't know how to use it to get an age. I "think" i need to turn the data in the drop down into a time stamp, but i maybe wrong. Do you guys have any tips or know any place i can look to find out how to do this?

Link to comment
Share on other sites

assuming the user is picking their birthday through these dropdowns, at the very simplest, it would be subtracting the current year from the year they selected. The tricky part is knowing if their birthday has come or gone, by which you can add the number of years to their birthdate timestamp, check if its greater than or equal to the current date, and if it isn't, subtract 1 from their age. Theres probably slicker ways to do it, but that's just off the top of my head.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...