在今天的午夜获取时间戳? [英] Getting a timestamp for today at midnight?

查看:68
本文介绍了在今天的午夜获取时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何在今天的午夜用php获取时间戳.假设今天是星期一下午5点,我希望星期一(今天)的午夜(12点)的时间戳已经发生.

How would I go about getting a timestamp in php for today at midnight. Say it's monday 5PM and I want the Timestamp for Monday(today) at midnight(12 am) which already has happened.

谢谢

推荐答案

$timestamp = strtotime('today midnight');

您可能想看看PHP提供的功能: http://php.net/datetime

You might want to take a look what PHP has to offer: http://php.net/datetime

这篇关于在今天的午夜获取时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆