need help with Time function

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum Active User
php-forum Active User
Posts: 365
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Wed Aug 01, 2012 5:21 am

As always, let us know what code you have and what point you are stuck at. You will need to record the forum post date/time in a database.

php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Fri Aug 03, 2012 7:25 pm

pseudo code:

Code: Select all

1.get the posted date 
2. get todays' date
3.get the difference between 1 and 2
4.convert the difference to seconds
5.Now, the convert the difference to months or days or years
This article may help you to some extent: ... ds-in-php/

Post Reply