PHP code example of linhuan / roc_ad_date_convert
1. Go to this page and download the library: Download linhuan/roc_ad_date_convert 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/ */
linhuan / roc_ad_date_convert example snippets
ocAdDateConvert\RocAdDateConvert;
// 將ROC轉換為AD
$rocDate = '110-01-01';
$adDate = RocAdDateConvert::convertROCToAD($rocDate);
echo "ROC 日期: $rocDate, AD 日期: $adDate\n";
// 將AD轉換為ROC
$adDate = '2024-01-01';
$rocDate = RocAdDateConvert::convertADToROC($adDate);
echo "AD 日期: $adDate, ROC 日期: $rocDate\n";