PHP code example of fadyreda99 / laravel-date-helper

1. Go to this page and download the library: Download fadyreda99/laravel-date-helper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fadyreda99 / laravel-date-helper example snippets



use Fadyreda99\DateHelper\DateHelper;

$date = DateHelper::toMysqlDate('٠٣/٠٤/٢٠٢٤');
// "2024-04-03"

use Fadyreda99\DateHelper\DateHelper;

class MyController
{
    public function store(DateHelper $dates)
    {
        $clean = $dates->toMysqlDate('March 4, 2024');
        // "2024-03-04"
    }
}

DateHelper::toMysqlDate('1609459200000');
// "2021-01-01"

null