PHP内置函数echo的功能是,php中strtotime函数具有哪些功能呢?

摘要:

下文讲述php中strtotime函数的功能说明,如下所示;

php之strtotime函数功能

php之strtotime函数:

将英文文本的日期或时间转换为unix时间戳

php之strtotime函数语法:

strtotime(time,now);

--------参数说明----

time:必填参数,待设置日期,时间字符串

now:非必填参数,设置用来返回值的时间戳,当省略此参数,则取当前时间

-------返回值说明-----

成功,则返回时间戳

失败,则返回FALSE

------注意事项-----

1.当年份使用两位数时,则0~69代表2000~2069

值70~100,则代表1970~2000

2. m/d/y 或 d-m-y 格式

php之strtotime函数的示例说明

echo "maomao365.com php strtotime函数示例分享\n";

echo(strtotime("now") . "\n");

echo(strtotime("20 October 2020") . "\n");

echo(strtotime("+3 hours") . "\n");

echo(strtotime("+2 week") . "\n");

echo(strtotime("+2 week 13 days 17 hours 30 seconds") . "\n");

echo(strtotime("next Monday") . "\n");

echo(strtotime("last Sunday"));

?>

//输出

maomao365.com php strtotime函数示例分享

1605104234

1603152000

1605115034

1606313834

1607498264

1605484800

1604793600

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值