need help with Time function

General discussions related to php

Moderators: macek, egami, gesf

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

Re: need help with Time function

Post by freshnet » 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.

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

Re: need help with Time function

Post by johnj » 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:
http://phillipnb.wordpress.com/2012/04/ ... ds-in-php/

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest