Learn how to program OOP in PHP and convert MySQL timestamp to the “Ago” format. Using a PHP class. Get the Zip Download Package Here: www.developphp.com
Reader Interactions
Comments
Huda6000says
So how do i apply it in the code? Do i paste all that code next to the post or do i put something else next to the post.? Im just really confused how you put in in the page…do you put all of the php code lines and put them in the code on the site?
I had a time_ago function and the problem encountered was similar to this. You see, It’s working if my posted article is from yesterday. But, when I try to post an article just a minute ago, the function you provided returns an HOUR instead of minutes. Like this comment is posted today and when I try to use your script it will return 7 HOURS ago? Weird or is it just because of my computer’s local time?
@kwvideo Works now. I had to Ssh in to both of my servers and change the time. Its 20 seconds behind but thats fine. When i am done with the site i will have it all on one box.
This has been working for a while for me. Today when i posted on my site. The Time Stamp was 2010-07-04 10:37:33. Its saying -13536 secs ago. I have Php5.
Great tutorial 5/5 or 1thumb up LOL idk but i think another good tutorial would be how u made that very nice chatroom in flash i havent figured out how to make action script code to make an online user …thigy lol for lack of a better word
@flashbuilding Naw I don’t think so at all. It would make my web apps cleaner and more powerful. I’d love to go a little further. You’re awesome. Just thought you’d like to know I also got a call from a client on web intersect 😉
I only have one problem with your tuts, every time I watch them…I end up getting awesome sauce all over my screen !! You Rock Adam, Thanks for the great tut
Huda6000 says
So how do i apply it in the code? Do i paste all that code next to the post or do i put something else next to the post.? Im just really confused how you put in in the page…do you put all of the php code lines and put them in the code on the site?
AsianManTi says
Can this be used with other time format besides unix?
cryde12 says
It’s stupid …
You don’t use correctly the object (and the POO)
Use a function to it would have been better
psoupcms says
Hello @ flashbuilding!
I had a time_ago function and the problem encountered was similar to this. You see, It’s working if my posted article is from yesterday. But, when I try to post an article just a minute ago, the function you provided returns an HOUR instead of minutes. Like this comment is posted today and when I try to use your script it will return 7 HOURS ago? Weird or is it just because of my computer’s local time?
realfun784 says
How to Use from database?
kwvideo says
@kwvideo Works now. I had to Ssh in to both of my servers and change the time. Its 20 seconds behind but thats fine. When i am done with the site i will have it all on one box.
kwvideo says
@kwvideo I think i might of found out what the issue is. My Test server and Mysql server has two different times.
kwvideo says
This has been working for a while for me. Today when i posted on my site. The Time Stamp was 2010-07-04 10:37:33. Its saying -13536 secs ago. I have Php5.
Caliosg says
that’s my post he’s reading out lol
i can’t thank you enough!
de8struction says
Great tutorial 5/5 or 1thumb up LOL idk but i think another good tutorial would be how u made that very nice chatroom in flash i havent figured out how to make action script code to make an online user …thigy lol for lack of a better word
ssuhotcoco25 says
@flashbuilding Naw I don’t think so at all. It would make my web apps cleaner and more powerful. I’d love to go a little further. You’re awesome. Just thought you’d like to know I also got a call from a client on web intersect 😉
ra2yuri4 says
Adam once again wins!
thanks man!
rustyroother says
A new YouTube, Cool.
PersonalComputerHelp says
very nice. This will be very handy for my chat app 🙂
MrShawnlloyd says
I only have one problem with your tuts, every time I watch them…I end up getting awesome sauce all over my screen !! You Rock Adam, Thanks for the great tut
danielvasic says
Realy, realy,…… cool man!!!!
THX :-))
gamemania61 says
Reaaly Coool 🙂
flashbuilding says
@ssuhotcoco25 – Not too dorky? lol we could go a lil further.
ssuhotcoco25 says
I like this. I want to learn more about OOP/DRY programming.
puggsy21 says
sweet dude just what i needed thanks alot bro have 5 * dude and a thumbs up lol