Confirm date laravel firmat with Ym-dTH: i: s

I am creating an API and should accept the date and time value as the format Ym-dTH:i:s . The peculiarity of this is that there T in the middle between date and time.

So how to write a validation rule to verify this?

 'start_at' => 'required|date_format:Ymd H:i:s' 

This is what I have.

+5
source share
1 answer

Try using \T as follows:

 'start_at' => 'required|date_format:Ymd\TH:i:s' 
+5
source

Source: https://habr.com/ru/post/1275502/


All Articles