PHP code example of tkstarir / tkstarjdc

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

    

tkstarir / tkstarjdc example snippets



use \TkStar\LaunchPad\Components as Component;

echo(join('-', Component\TkStarJDC::JalaliToGregorian(1378, 11, 16))); // Result => 2000-2-5

echo(strtotime(join('-', Component\TkStarJDC::JalaliToGregorian(1378, 11, 16)))); // Result => 949705200

echo(join('/', Component\TkStarJDC::GregorianToJalali(2000, 02, 05))); // Result => 1378/11/16

$array = Component\TkStarJDC::JalaliToGregorian(1378, 11, 16)); // Result => Array ( year, month, day )

$array = Component\TkStarJDC::GregorianToJalali(2000, 02, 05)); // Result => Array ( year, month, day )



use \TkStar\LaunchPad\Components as Component;

$array = Component\TkStarJDC::Occasions('2000-02-05', 'gregorian'); // Result => Array ( ... )

$array = Component\TkStarJDC::Occasions('2000/02/05', 'gregorian'); // Result => Array ( ... )


use \TkStar\LaunchPad\Components as Component;

$array = Component\TkStarJDC::Occasions('1378-11-16', 'jalali'); // Result => Array ( ... )

$array = Component\TkStarJDC::Occasions('1378/11/16', 'jalali'); // Result => Array ( ... )


use \TkStar\LaunchPad\Components as Component;

$check_distance = Component\TkStarJDC::Check_Distance('2022-11-09', '2000-02-05'); // Result => Array ( ... )

var_export($check_distance);

/*
  array (
    'is_reverse' => false,
    'total_seconds' => 718243200.0,
    'years' => 22,
    'months' => 4,
    'days' => 5,
    'hours' => 0,
    'minutes' => 0,
    'seconds' => 0.0,
  )
*/