Search
 
SCRIPT & CODE EXAMPLE
 

PHP

date casting from datetime to d-m-Y laravel

/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
   'created_at' => 'datetime:Y-m-d',
   'updated_at' => 'datetime:Y-m-d',
   'deleted_at' => 'datetime:Y-m-d h:i:s'
];
Comment

Laravel convert datetime to date

laravel convert timestamp to date
date('Y-m-d', strtotime($date));

laravel convert date to timestamp
date('Y-m-d H:i:s', strtotime($date));
Comment

PREVIOUS NEXT
Code Example
Php :: delete folder laravel 
Php :: use app name in laravel blade 
Php :: wordpress Access-Control-Allow-Origin 
Php :: illuminate database queryexception could not find driver laravel 9 
Php :: file delete in laravel 
Php :: string contains string laravel 
Php :: php stdclass to array 
Php :: hide php extension in url 
Php :: Hours to minute convert in php 
Php :: php directory exists 
Php :: laravel foreach loop index 
Php :: this load session codeigniter 
Php :: php set content type pdf 
Php :: php multidimensional array search by value 
Php :: php sec into date time 
Php :: add leading zeros in php 
Php :: first character uppercase php 
Php :: laravel db seed specific class 
Php :: remove last letter php 
Php :: comment supprimer balise script hmtl en php regex 
Php :: php find keyword in string 
Php :: old value in laravel 
Php :: E: Unable to locate package php7.2-mbstring 
Php :: laravel get random row 
Php :: laravel bindings query 
Php :: php get method name 
Php :: laravel assign active based on route name 
Php :: wordpress errors 
Php :: woocommerce custom sale banner, sash 
Php :: highlight search text in php 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =