Topic: Proper Date Format for Post

Some people complained about the page pagination plugin that does not work. In general, these plugins are works by sorting the blog posts by published date, it must be known that this field will become very sensitive and should be written in the correct format:

// YYYY-MM-DD HH:MM:SS
Example: 2014-02-30 24:10:04

I would recommend this format because this date format is easy to read, and also can be converted easily into another format by using PHP strtotime

$test = '2014-02-30 24:10:04';
echo date('Y/m/d', strtotime($test)); // => 2014/02/30
XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website

Re: Proper Date Format for Post

You proposition to use this date format 2014-02-30 24:10:04 and it will resolve the problem ?

Monstra Loves You! Give some love back!

3 (edited by tovic 2014-02-14 17:43:40)

Re: Proper Date Format for Post

I don’t know where to post topic about suggestions so I just use the question space.

Awilum wrote:

You proposition to use this date format 2014-02-30 24:10:04 and it will resolve the problem ?

Yes, because this time pattern is very readable but structured and has been used as the standard date format for the database (at least in another CMS that I use, and in Monstra off course).

XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website

Re: Proper Date Format for Post

good) thanks for sharing)

Monstra Loves You! Give some love back!

Re: Proper Date Format for Post

How to change date format in d/m/Y ?

Re: Proper Date Format for Post

You answered your own question:

<?php echo date('d/m/Y', strtotime($page['date'])); ?>

http://php.net/manual/en/function.date.php

XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website

Re: Proper Date Format for Post

tovic wrote:

You answered your own question:

<?php echo date('d/m/Y', strtotime($page['date'])); ?>

http://php.net/manual/en/function.date.php

we put code;