• Advertisement
Sign in to follow this  

[web] Birthday

This topic is 4071 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement