转换为日期格式 dd/mm/yyyy

2022-01-15 00:00:00 format date php

我有以下日期:2010-04-19 18:31:27.我想将此日期转换为 dd/mm/yyyy 格式.

I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format.

推荐答案

你可以使用正则表达式或一些手动字符串摆弄,但我想我更喜欢:

You can use a regular expression or some manual string fiddling, but I think I prefer:

date("d/m/Y", strtotime($str));

相关文章