MyBB-Plugins Forums
How to? Post date change - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: MyBB General Discussion (http://forums.mybb-plugins.com/Forum-MyBB-General-Discussion)
+--- Forum: Coding Help (http://forums.mybb-plugins.com/Forum-Coding-Help)
+--- Thread: How to? Post date change (/Thread-How-to-Post-date-change)



How to? Post date change - xconrex - 06-15-2014

Hello all,

When posting it will give a date.
Example when somebody posted a week ago it will appear as '8-06-2014'.

Is there a way I can turn this date into 'A week ago' ?
I'm not a PHP Developer so I'm wondering how hard this is to make.

Been browsing through the docs and came across this.
http://php.net/manual/en/function.strtotime.php
Is that related?

Anyhow, if somebody could tell me how to do this it would be appreciated.
Would also not mind paying a small fee for it.

Thanks!


RE: How to? Post date change - Diogo Parrinha - 06-15-2014

You will need to use relative time. MyBB 1.8 comes with it.
http://www.php.net//manual/en/datetime.formats.relative.php
http://stackoverflow.com/questions/2690504/php-producing-relative-date-time-from-timestamps
http://gilbert.pellegrom.me/php-relative-time-function/


RE: How to? Post date change - xconrex - 06-15-2014

(06-15-2014, 07:29 PM)Pirata Nervo Wrote: You will need to use relative time. MyBB 1.8 comes with it.
http://www.php.net//manual/en/datetime.formats.relative.php
http://stackoverflow.com/questions/2690504/php-producing-relative-date-time-from-timestamps
http://gilbert.pellegrom.me/php-relative-time-function/

Thank you for your quick reply.
I'll wait it out then, thanks! Big Grin


RE: How to? Post date change - Diogo Parrinha - 06-15-2014

No problem Smile


RE: How to? Post date change - papclems - 01-08-2015

(06-15-2014, 09:03 PM)Pirata Nervo Wrote: No problem Smile

and if i would to come back to a previous way, linke instead "6 hours ago" i would have "9.55.00"

is it still possibile with 1.8?


RE: How to? Post date change - Diogo Parrinha - 01-08-2015

Yes, you need to set the my_date parameter related to date format to the format you want.


RE: How to? Post date change - papclems - 01-08-2015

(01-08-2015, 01:10 AM)Pirata Nervo Wrote: Yes, you need to set the my_date parameter related to date format to the format you want.

and where i found this parameter and how i change it?

(right now i've installed a plugin who solve the problem.  http://doylecc.altervista.org/en/time.html ) but if i may not use a plugin is even better. Big Grin

thank you again for your help


RE: How to? Post date change - Diogo Parrinha - 01-08-2015

Oh I'm sorry but this is not for support related to MyBB features but actually coding help. If you want support for general stuff, you need to subscribe.


RE: How to? Post date change - papclems - 01-08-2015

(01-08-2015, 03:01 AM)Pirata Nervo Wrote: Oh I'm sorry but this is not for support related to MyBB features but actually coding help. If you want support for general stuff, you need to subscribe.

Thank for the previous help and for this information.