转换为日期格式dd / mm / yyyy [英] 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文