PHP code example of nickmoline / laravel-stardate

1. Go to this page and download the library: Download nickmoline/laravel-stardate 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/ */

    

nickmoline / laravel-stardate example snippets


$date = Carbon::parse("April 5, 2023");
$date->isFirstContactDay(); # true
$date->isStarTrekDay(); # false
$date->nextAncestorsEve(); # "April 22, 2023"
$date->untilNextAncestorsEve(); # "17 days"
$date->trekHoliday(); # "First Contact Day"
$date->isTrekHoliday(); # true

$date->addDays(2);
$date->trekHoliday(); # null
$date->isTrekHoliday(); # false
$date->sinceFirstContactDay(); # "2 days"