Jump to content


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

datepicker db

  • Please log in to reply
6 replies to this topic

#1 leonaze31

leonaze31

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 September 2012 - 02: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.

#2 saulimus

saulimus

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 12 September 2012 - 03:05 PM

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

#3 leonaze31

leonaze31

    Newbie

  • Members
  • Pip
  • 3 posts

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 ?

#4 saulimus

saulimus

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 13 September 2012 - 05:00 PM

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

#5 leonaze31

leonaze31

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 September 2012 - 01: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.

#6 Andrea Pagliarani

Andrea Pagliarani

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 03 December 2012 - 03:49 PM

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

Have you solved the problem?

#7 victor

victor

    grocery CRUD Hero

  • Advanced Member
  • PipPipPip
  • 967 posts
  • LocationMinsk

Posted 03 December 2012 - 07:00 PM

http://stackoverflow...m-dd-dd-mm-yyyy





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users