Sign in to follow this  
dogbert234

[web] Birthday

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this