I have a really basic question regarding unix timestamp and mysql date. I am trying to create a small website where users can register and fill out their date of birth.
The problem is that unix starts on January 01, 1970. Now, if I am calculating the age for users, specify dates such as date ('mdY', $ unix_from_db), etc., this will crash users over 40 years old, right?
So what would be the only way to do this. Unfortunately for a basic question like this, but I'm inexperienced with php and mysql.
// Edit: Thank you all. I was embarrassed because the date ('mdy', mktime (0,0,0,1,1,1890)) and the date ('mdy', - 2000) came back 01.01.70 - next time I will study the manual more carefully . I was able to fix my site, thanks again. It is a pity that I can only accept one answer, they are all equally good.
source
share