开发者

How to convert yyyy/mm/dd to dd/mm/yyyy?

开发者 https://www.devze.com 2023-03-26 10:11 出处:网络
I would like to convert yyyy/mm/开发者_如何学Cdd to dd/mm/yyyy format.So, I am using strtotime() function.but when I get zero date like(0000/00/00) from mysql. It will be showing wrong date like(01-01

I would like to convert yyyy/mm/开发者_如何学Cdd to dd/mm/yyyy format.So, I am using strtotime() function.but when I get zero date like(0000/00/00) from mysql. It will be showing wrong date like(01-01-1970).

I need exact string like 0000/00/00 to 00/00/0000. any other function are there?


Try MySQL's DATE_FORMAT() function

SELECT DATE_FORMAT(dateColumn,'%d/%m/%Y') AS dateColumn FROM table...


Try to use strftime

strftime("%d-%b-%Y", strtotime($value['your_date']));
0

精彩评论

暂无评论...
验证码 换一张
取 消