⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Why date in DB format is yyyy-mm-dd ?



leonaze31

leonaze31
  • profile picture
  • Member

Posted 12 September 2012 - 14:32 PM

Hi,

I don't understand why my dates save in DB with the format yyyy-mm-dd ?

In Grocery CRUD config i do this :
$config['grocery_crud_date_format] = 'uk-date';


I load a french translation for the datepicker with :
dateFormat: 'dd/mm/yy'


But in my DB i have like that : 2012-09-21

Thanks for the answers.

saulimus

saulimus
  • profile picture
  • Member

Posted 12 September 2012 - 15:05 PM

Because your DB stores the date in that format.
http://dev.mysql.com...n/datetime.html

leonaze31

leonaze31
  • profile picture
  • Member

Posted 13 September 2012 - 09:16 AM

Thanks. But I try to make my date to a varchar in db and do change_field_type to date but it don't works.

There is a solution ?

saulimus

saulimus
  • profile picture
  • Member

Posted 13 September 2012 - 17:00 PM

Umm, why would you? That's what the sql date type is meant for.. :huh:

leonaze31

leonaze31
  • profile picture
  • Member

Posted 14 September 2012 - 13:45 PM

Because I just need the date to display it in this format "dd/mm/YYYY" and I don't understand why a varchar is interpreted like a date.

So I do this in php thanks for the reply.

Andrea Pagliarani

Andrea Pagliarani
  • profile picture
  • Member

Posted 03 December 2012 - 15:49 PM

I have same problem.
I need the date to display it in this format "dd/mm/YYYY".

Have you solved the problem?

victor

victor
  • profile picture
  • Member

Posted 03 December 2012 - 19:00 PM

http://stackoverflow.com/questions/2487921/convert-date-format-yyyy-mm-dd-dd-mm-yyyy