PHP code example of bigfishtv / partial-date
1. Go to this page and download the library: Download bigfishtv/partial-date 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/ */
bigfishtv / partial-date example snippets
use Bigfish\PartialDate;
// from Australian date format to SQL
$date = new PartialDate('2/2015');
echo $date->toSQLFormat(); // outputs 2015-02-00
// from SQL date format to Australian
$date = new PartialDate('2015-02-00');
echo $date->toAusFormat(); // outputs 02/2015
// parse method
$data = new PartialDate();
$date->parse('12/12/14');
// setDate method
$data = new PartialDate();
$date->setDate(2015, 2, 3);