Convert to date format dd/mm/yyyy(转换为日期格式 dd/mm/yyyy)
问题描述
我有以下日期: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));
这篇关于转换为日期格式 dd/mm/yyyy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!