Illuminate\Database\Eloquent\Model::fromDateTime PHP Method

fromDateTime() public method

Convert a DateTime to a storable string.
public fromDateTime ( DateTime | integer $value ) : string
$value DateTime | integer
return string
    public function fromDateTime($value)
    {
        $format = $this->getDateFormat();
        $value = $this->asDateTime($value);
        return $value->format($format);
    }

Usage Example

Example #1
0
 public function fromDateTime($value)
 {
     return strtotime(parent::fromDateTime($value));
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::fromDateTime
Model