Setting Date Format

Under Language Settings in 7.2.1, I can set the date and time formats. I set the long date format for PHP and that changed how the date displays on the profiles. Perfect.

 

But what are the database formats used for? Dates and times should always be stored in one specific format. And they should then be converted to desired format for display. The settings for PHP seem to affect display. So why the database ones?

 

Should I leave the database ones alone or set them to match the PHP ones?

Quote · 10 Jan 2016

You have to realise that Dolphin code has been handled by many people since day one.  At first no standard guidelines were put in place so the code has many different formats.  Boonex has since changed that.  You will find dates stored in the database in the Unix timestamp as well as in string format.  I would leave things as you find them unless you are willing to rewrite code that you will have to maintain (I do) with version upgrades.  This is what happens with programmes as they grow in scope.  Window's code is a horrible mess; regardless of what MicroCrap states, I bet there are DOS routines still hidden in the spaghetti pile that is Windows.

 

To try and clean things up would be too time consuming and too costly; best to just fix the bugs that really matter.

Geeks, making the world a better place
Quote · 10 Jan 2016

Yes, I avoid making changes that need to maintained whenever possible.

 

But why have a setting that can be changed if it shouldn't be changed? Obviously, it would be a bad idea to change a date format AFTER data has been added to site if some dates are stored in that format as strings.

 

I dumped the database from a fresh install. The only date is the registration date of the admin user and it uses a MySQL datetime field.

 

I certainly don't want to make a breaking change, but if those string dates are ever displayed as is, I would prefer if they were in a format that I liked. If they're never displayed, then it's not as big a deal, but I would prefer that they were stored in MySql format.

 

And if there was ever a good time to make a change like this, it would be on a fresh install.

 

Do you use a custom date format?

Quote · 10 Jan 2016

I got a response directly from Boonex.

 

-------------------

Formats don't affect how date/time fields are stored, but they affect how date/time is displayed on the site. So you can change it at anytime without any affect on the stored data.

The reason to have database and php formats is that format strings are used in SQL queries and PHP code.

-------------------

Quote · 25 Jan 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.