我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用Ymd Th:i:s验证laravel日期格式

I'm building an API and it should accept date and time value as the format of Y-m-dTH:i:s. The specialty of this that there's T in the middle between date and time.

So, how to write validation rule to check this ?

'start_at' => 'required|date_format:Y-m-d H:i:s'

This is what I currently have.

Try to use \T like this:

'start_at' => 'required|date_format:Y-m-d\TH:i:s'

近期文章

  • 无法多次POST同一个文件
  • JQuery将HTML实体/表情符号发布到PHP服务器
  • 如何重写使用AJAX的方法?
  • 接口的CodeIgniter命名约定
  • 使用Swift Mailer我收到此错误?
  • 使用PHP DOMDocument连接HTML表
  • 使用PHP将XML数据添加到不同的节点
  • AJAX登录表单需要允许浏览器cookie
  • aws ec2上的php文件写入权限被拒绝
  • 搜索存储库github内的目录
  • 使用modal存储数据并传递$ id变量
  • 在HTML / PHP文件中访问SQLite3数据库?
  • 在1个php文件中处理多个CSV文件
  • 在我的网站上集成Wordpress帖子/博客
  • PHP Javascript - 数组多维错误
  • bcpow和pow有什么区别?
  • Laravel重定向时没有消息错误
  • 如何将当前时间戳插入数据库?
  • 表单变量不通过POST
  • 为什么有些二进制文件不能与shell_exec一起使用?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华