dd mm yyyy date format - how?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
graham
Veteran Member
Posts: 89
Joined: 2020-09-29 12:30

dd mm yyyy date format - how?

Post by graham » 2024-04-15 15:21

Hi, I'm using the date picker in 24:12 and and need UK style dd mm yyyy format. But at the moment it's going to my database (as shown in phpMyAdmin) as yyyy mm dd. I can see the option of UK short date form but even if I choose that, it's still going into the database as yyyy mm dd. Perhaps this isn't an AppGini thing? - perhaps it's phpMyAdmin or MySQL itself? Any help appreciated.

graham
Veteran Member
Posts: 89
Joined: 2020-09-29 12:30

Re: dd mm yyyy date format - how?

Post by graham » 2024-04-15 15:31

Sorry, I should have persisted with my research? I think the answer is that mysql is the problem and I have to retrieve it as I want to by using SELECT DATE_FORMAT(your_date_column, '%d %m %Y') AS formatted_date FROM your_table; if that's wrong, please let me know! Thanks.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: dd mm yyyy date format - how?

Post by jsetzer » 2024-04-16 16:19

Unless you reconfigure your MySQL Server or database, dates will always be stored in yyyy-mm-dd format, by default.

This means we have to change output format when retrieving from database (as you have already mentioned before) or when displaying date values in UI.

Helpful AppGini function in PHP:

Code: Select all

$db_date = '2024-04-16';
$d_formatted = app_datetime($db_date, 'd');
That useful function already takes app-configuration into consideration. It returns the date as string according to your locale settings, defined in the project itself.

Hope this helps.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

Post Reply