php-carbon - Carbon::today()->toDateString() 不等于今天的日期
问题描述
对于我的代码:
$today = Carbon::now()->toDateString();
$compare = Carbon::today()->toDateString() == '2020-12-03' ? 'yes' : 'no';
Log::debug('today '.$today);
Log::debug('compare '.$compare);
它返回给我:
2020-12-03
no
任何人都可以帮助向我解释为什么它返回“否”而不是“是”。
解决方案
推荐阅读
- vulkan - 为什么 vulkan 子通道内容不能同时是内联和辅助命令缓冲区?
- reactjs - npm 在 create-react-app 后开始显示错误
- node.js - MongoDB:如何使用条件递归获取所有子节点的计数?
- java - Maven 在构建我们自己的 custom.jar 时发布和使用第三方运行时 jar
- sql - 在 BigQuery 中获取在同一天安装和卸载应用程序的用户以及卸载时间
- amazon-web-services - Fargate 服务的启动类型与容量提供者策略
- spring - 使用 spring-data-jdbc 和 spring-session-redis
- reactjs - 会话字段为无
- conditional-statements - 电力自动化向已在公司工作一个月的客户发送调查问卷?
- python - 层序的输入 0 与层不兼容: