actualizar formato de fecha
Frecuentes
Visto 105 veces
1 Respuestas
4
Use esto en su lugar:
date('Y-m-d')
Also, if you just want to use the current time/date and your MySQL server is in the same timezone as your web server, you can utilizado NOW()
en tu SQL preferiblemente.
contestado el 03 de mayo de 12 a las 21:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas php html or haz tu propia pregunta.
Thanks Brad it worked but I want to have this format d-m-Y when I output the date to the table - user1347219
@user1347219, You must use this format when inserting data into your data. If you want to format the data when you output it del the table, then you should do that with PHP:
date('d-m-Y', strtotime($your_mysql_date))
Don't store formatted dates in the database. Use datetime or timestamp columns as appropriate, and leave formatting of data up to PHP. - Brad