Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

check if valid date format entered inside the excel import php

try {
  Date::excelToDateTimeObject(trim($row[5]))->format('Y-m-d');
} catch (Exception $exception) {
  throw ValidationException::withMessages([
    'file' => "contains incorrect date format, should be in Y-m-d format"]
  ]);
}
 
PREVIOUS NEXT
Tagged: #check #valid #date #format #entered #excel #import #php
ADD COMMENT
Topic
Name
6+6 =