Date format | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Date format

how to set date format

5th Feb 2017, 3:22 PM
Atul
2 Answers
+ 1
I used phpMyAdmin to set the data type of a column as date. You'll be advantaged when handling the data in your script as it follows a standard with many premade functions to do calculations and formatting. Remember that the format of the date to be stored in the db must be yyyy-mm-dd like 2017-12-13. In phpMyAdmin go on the table structure page, select the column you want to hold dates and click on change. from the dropdown menu (after the column Name input field) chose date. click ok and you are done. Make sure the data in the column follows the a.m. date format.
5th Feb 2017, 5:04 PM
seamiki
seamiki - avatar
0
Use a column to store date and then select from tableName where dateColumn = (yyyy-mm-dd)
5th Feb 2017, 4:23 PM
Andre van Rensburg
Andre van Rensburg - avatar