1. Go to this page and download the library: Download baumrock/humandates 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/ */
baumrock / humandates example snippets
// manual download
// composer /autoload.php";
// create HumanDates instance
$dates = new HumanDates();
echo $dates->format("2023-01-01"); // 1. Jan 2023
echo $dates->range("2023-01-01", "2023-01-03"); // 1. - 3. Jan 2023
// example using locale de_DE
echo $dates->range("2023-01-01", "2023-01-03", [
'default' => ['d. MMMM y', ' bis ', 'd. MMMM y'], // 1. Januar 2023 bis 3. Februar 2024
'sameYear' => ['d. MMMM', ' bis ', 'd. MMMM y'], // 1. Januar bis 3. Februar 2023
'sameMonth' => ['d.', ' bis ', 'd. MMMM y'], // 1. bis 3. Januar 2023
'sameDay' => ['d. MMMM y'], // 1. Januar 2023
]);