December 27th, 2012, 12:45 AM
My supervisor siad, I should make my project more user friendly.
Please, how can i convert : 25-12-2012 9:04 to » : two days ago by 9:04
Convert :27-12-2012 7:42 »to : just now
December 27th, 2012, 04:52 AM
Depends on the rules you want to follow. When does it transition from "one day ago" to "two days ago"? How long does the "just now" period last?
Either way you'll be looking at dates or timestamps. Protips:
* Learn about date() time() mktime() and strtotime()
* You can use date() to get the components of a date by themselves, such as the year or minute
* Subtracting timestamps, which you can get from time() mktime() and strtotime(), can tell you the number of seconds elapsed
December 27th, 2012, 05:03 AM
Thanks you so much.
But, the Time I have to finish the project Is too short for me to start going deeper into those functions .
Please, If you can give me an example or clue how those functions can manipulate time ..by converting it the way I want it ...I will be very grateful.
December 27th, 2012, 08:41 AM
I got a couple otions for you. My question is, what do you all want it to say? Only like 4 items? i.e. Just Now, Today, One Day Ago, Two Days Ago? Or what after 2 days? Maybe 1-7 days ago, being a week, then just have it state the time it was posted when beyond that?