如何使用php获取昨天的日期? [英] how to get date of yesterday using php?
本文介绍了如何使用php获取昨天的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用php中的特定日期格式获取昨天的日期,该格式为:
I want to get the yesterday date using specific date format in php this is the format:
$today = date("d.m.Y"); //15.04.2013
有可能吗?
如果应该分别更改月份和年份,则要加以考虑。
Take consideration of month and years if they should be changed in respective.
推荐答案
您去过
date('d.m.Y',strtotime("-1 days"));
如果月份更改,这也将起作用
this will work also if month change
这篇关于如何使用php获取昨天的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文