dimanche 1 octobre 2017

PHP DateTime Invalid Auction end date

I have coded an Laravel Auction Bid Script for Products.

If i want create an new Product i can enter the "End Date" for the Auction.

But i get always this Error: "Invalid end date"

I have try now all Dates variants and i am a little bit desperate.

My code line for the Auction End Date in Laravel 5 ProductController:

if (validateDate($request->end_date)) {
          $end_date = DateTime::createFromFormat('Y-m-d\TH:i',$request->end_date);
          $now = date('Y-m-d\TH:i');
          $end_date1 =  date_format($end_date,'Y-m-d\TH:i');
          if ($end_date1 < $now) {
            session()->flash('errormessage','Invalid end date');
            return redirect()->back()->withInput();
          }

Now i must enter the Date and Clock in this formate,right?

2017-10-22\15:00

End Date and time



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2g0CbXJ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire