mysql timestamp manipulation


Posted on 16th Feb 2014 07:03 pm by admin

How could I use a timestamp (e.g 2009-10-30 13:20:35 ), and with php find out if it is:

from today
from this week
from this month
from the last 3 months
from the last 6 months
from this year
from 1 year ago
etc etc

?

Thanks

No comments posted yet

Your Answer:

Login to answer
216 Like 11 Dislike
Previous forums Next forums
Other forums

error with opendir
when i do this

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($han

Streaming local file from PHP while it’s been written to by a CURL process
I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a

Grouping and sorting results
Please help with this query.

I have 2 tables in a database, countires and cities. states look

IP Based Cron Jobs
I run cronjobs on my website. After one of my visitors got curious and tinkered around he realized h

Image loading
Hi Developers,

I'm trying to display an image from images/image.gif getting the url from mysq

the problem with str_replace
$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);

that old Malformed Headers problem again!!!!! HELP!!!!!!
I've read the http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

I don't think my c

Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash