Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php validate date format yyyy-mm-dd

$date="2012-09-12";

if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$date)) {
    return true;
} else {
    return false;
}
Comment

php validate date format dd mm yy hh mm ss

/^(?:[0-9]{4}-[0-9]{2}-[0-9]{2})?(?:[ T][0-9]{2}:[0-9]{2}:[0-9]{2})?(?:[.,][0-9]{3})?/gm
  
2019-04-29 this line has only date
2019-04-29 14:10:32 this line has date and time without the "T" separator
2019-04-29T14:10:32 this line has date and time with the "T" separator
2019-04-29T14:10:36 this line has no milliseconds
2019-04-29 14:10:32,999 this line has milliseconds using comma, but without the "T" separator
2019-04-29T14:10:32,999 this line has milliseconds using comma
2019-04-29T14:10:36.000 this line has milliseconds using decimal point
Comment

php date format dd-mm-yyyy

php date
Comment

PREVIOUS NEXT
Code Example
Php :: how to search by sku woocommerce 
Php :: php sort array by value length 
Php :: get am pm 12 hour timee laravel 
Php :: laravel reduce 
Php :: laravel disable csrf token 
Php :: laravel check empty string 
Php :: database collection to array 
Php :: php sort associative array by specific value 
Php :: get country from ip 
Php :: create a wp plugin 
Php :: use model from variable laravel 
Php :: php get current dir mac 
Php :: wordpress add_submenu_page 
Php :: Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 
Php :: php laravel intervention base64 to image save 
Php :: add two numbers as string in php 
Php :: laravel joins 
Php :: how to make-migrations in laravel 
Php :: javascript inside php 
Php :: how to check php version codeigniter 3 
Php :: php.ini location 
Php :: laravel 8 routes namespace 
Php :: laravel get first letter of each word 
Php :: Clear from faild_jobs laravel 
Php :: unable to open file error in php 
Php :: curl php 
Php :: php not recognized internal external command 
Php :: keep only n elements of array php 
Php :: php new stdClass object 
Php :: update user role wordpress 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =