Date Format in Mysql

MantisBT forum for users who prefer to ask and answer questions in French.

Moderators: Developer, Contributor

Post Reply
Mmarouane89
Posts: 49
Joined: Mar 24, 2015 5:41 pm

Date Format in Mysql

Post by Mmarouane89 » Mar 31, 2015 10:10 am

Hello,
when i add a date in custom field date the format changes, for example when i add: 2015-03-23 i find in database in mantis custom field string this value: 2343434 how i can get the format correctly ? mantis uses a specil function to save the date field in table ?

Mmarouane89
Posts: 49
Joined: Mar 24, 2015 5:41 pm

Re: Date Format in Mysql

Post by Mmarouane89 » Apr 01, 2015 4:16 am

i have founded it, Mantis uses this function date('Y-m-d H:i:s' 6323944) to show datetime in the pages

fabi
Posts: 3
Joined: May 12, 2009 8:26 am

Re: Date Format in Mysql

Post by fabi » Jun 29, 2015 3:13 am

Hi Mmarouane89!

Can you describe for me what it looks like is MySQL script?

so

Code: Select all

select function date ('Y-m-d'date_submitted )from mantis_bug_table
It does not work

Thank you

Mmarouane89
Posts: 49
Joined: Mar 24, 2015 5:41 pm

Re: Date Format in Mysql

Post by Mmarouane89 » Jun 29, 2015 3:19 am

In MySQL i get the value and i use a php function; for example: Select date from ...
$date = date('d-m-Y', $row[0]);

Post Reply