PHP中获取时间的下一周下个月的方法

yipeiwu_com5年前PHP代码库
复制代码 代码如下:

//通常用于定制服务的时候使用,比如包月会员,包年等等

//获取当前时间过一个月的时间,以DATETIME格式显示

date('Y-m-d H:i:s',strtotime('+1 month'))

//获取当前时间过一个月的时间,以时间戳格式显示

strtotime(date('Y-m-d H:i:s',strtotime('+1 month')))

//以下是年,月,周,天,时,分秒的用法

date("Y-m-d H:i:s", strtotime(" +2 year"));
date("Y-m-d H:i:s", strtotime(" +2 month"));
date("Y-m-d H:i:s", strtotime(" +2 week"));
date("Y-m-d H:i:s", strtotime(" +2 day"));
date("Y-m-d H:i:s", strtotime(" +2 hour"));
date("Y-m-d H:i:s", strtotime(" +2 minute"));
date("Y-m-d H:i:s", strtotime(" +2 second"));

相关文章

PHP5中虚函数的实现方法分享

请看下面的代码: 复制代码 代码如下: <?php class A { public function x() { echo "A::x() was called.\n"; } p...

php求斐波那契数的两种实现方式【递归与递推】

本文实例讲述了php求斐波那契数的两种实现方式。分享给大家供大家参考,具体如下: 斐波那契数,亦称之为斐波那契数列(意大利语: Successione di Fibonacci),又称黄...

ECSHOP完美解决Deprecated: preg_replace()报错的问题

随着PHP5.5 的普及,ECSHOP系统又爆出了新的错误。PHP发展到PHP5.5版本以后,有了很多细微的变化。而ECSHOP官方更新又太慢,发现这些问题后也不及时升级,导致用户安装使...

php pki加密技术(openssl)详解

复制代码 代码如下:<?php//pki加密//使用pki加密需要开启 openssl扩展//php.ini extension = php_openssl.dll扩展/*pki模...

ucenter通信原理分析

1、用户登录discuz,通过logging.php文件中的函数uc_user_login对post过来的数据进行验证,也就是对username和password进行验证。 2、如果验证...