Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 个函数来检查今天是否是本月的第一天。其中一个是否比另一个有优势,即准确性?
if(date('j', $timestamp) === '1') { } if(date('Y-m-d') == date('Y-m-01')) { }
第一个检查较少,我会使用它。
如果您想现在/今天检查,您也不需要时间戳参数