Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excel format date for mysql

Tags:

mysql

excel

My excel sheet has the following format : dd/mm/YYYY

ex: 24/10/2010 (european format)

and my mysql needs: YYYY-mm-dd (US format)

How can I format the date in Excel to have this US format ? I tried with cell format, but I don't have the desired format

Regards

like image 452
yarek Avatar asked Jan 27 '11 13:01

yarek


People also ask

How do I change MySQL date format from DD MM to YYYY?

MySQL uses yyyy-mm-dd format for storing a date value. This format is fixed and it is not possible to change it. For example, you may prefer to use mm-dd-yyyy format but you can't.

Can we change date format in MySQL?

Change the curdate() (current date) format in MySQL The current date format is 'YYYY-mm-dd'. To change current date format, you can use date_format().

How do you insert a date in MySQL?

The default way to store a date in a MySQL database is by using DATE. The proper format of a DATE is: YYYY-MM-DD.


2 Answers

Here's how you can find this Number format in Excel:

  1. Go to Format Cells and then the Number tab.
  2. Select Date
  3. Change the Locale to English (U.K.)
  4. The fifth item on the list (on my U.S. version of Excel) is the format you're looking for.

Hope that helps!

like image 152
Scott Cranfill Avatar answered Sep 21 '22 06:09

Scott Cranfill


For the hours, minutes and second

go in the custom category and enter this :

yyyy-mm-dd hh:mm:ss

like image 40
jpprade Avatar answered Sep 22 '22 06:09

jpprade