[web] Birthday
Hi,
I'm trying to make a script, where user can isert his/her birthday, but I don't know how to generate the time stamp from the input. I tried:
$age = time($day)+time($month)+time($year);
but it says my birthday is 19.1.2038...
How can I generate a proper time stamp?
i think the argument to the time constructor is a timestamp, not a day or month or year argument. certainly the way you have it coded it couldn't possibly work. how would the time constructor know that the first call is a day, the second a month and third a year.
-me
-me
Or, try strtotime(). It can generate unix timestamps from pretty much any date string (though it can be confused by US v.s european notations).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement