rootKID Posted March 22, 2014 Share Posted March 22, 2014 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 Link to comment Share on other sites More sharing options...
Petrucho Posted March 22, 2014 Share Posted March 22, 2014 (edited) 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 March 22, 2014 by Petrucho Link to comment Share on other sites More sharing options...
[dx] Posted March 22, 2014 Share Posted March 22, 2014 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 More sharing options...
rootKID Posted March 22, 2014 Author Share Posted March 22, 2014 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 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now