Jump to content

what is PHP time for 1 day? :)


Recommended Posts

Hello W3S!


I have a question, might seem stupid but here it goes..


I have tried search for it, but im trying to use the time() php function to a project of mine and i dont know how much time there is of 1 day...


can someone tell me etc? x)...


thanks hehe :P

Link to comment
Share on other sites

I'm not sure why you need it, but, time() return how many seconds have passed since January 1 1970 00:00:00 GMT.

If you want to know how many days have passed since a particular time() you saved before, then you should subtract the time() you saved earlier, from the the time() now.


Then a little math:

60 seconds = 1 minute

60 minutes = 1 hour

24 hours = 1 day

Edited by Petrucho
Link to comment
Share on other sites

time() is changed every second with +1.


60 seconds in 1 minute

60 minutes in 1 hour

24 hours in 1 day


So 60 x 60 x 24 = 86400 seconds in 1 day


Hope you need it?

Link to comment
Share on other sites

Thanks.. and yes, i do ;)... i'm trying to make a function fully dynamicly working to subtrack etc so it will post it out on my portfolio like a smooth charm...


Example: This message was posted (1 week) ago....


so far, working like a charm.. thanks for the help ;)

  • Like 1
Link to comment
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

  • Create New...