Subversion Repositories php-qbpwcf

Rev

Blame | Last modification | View Log | RSS feed

<?php

#宣告指派命名空間
namespace qbpwcf;

#匯入外部套件
include("../allInOne.php");

#提示目前要測試的涵式
echo"<hr>time::setTimeZone<br>";

/*

#涵式說明:
#設定時區
#必填的參數:
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
        #ex:"Asia/Taipei"
var_dump(time::setTimeZone($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getSystemDateAndTime - testCase 1<br>";

/*

#涵式說明:
#取得系統時間目前的西元年、月、日、時、分、秒
#回傳的結果:
#$result["thisWestYear"],當前西元年
#$result["thisMonth"],當前月份
#$result["weekDay"],為一個星期的第幾天,0代表第一天(星期日),6代表第七天(星期六)
#$result["thisDay"],當前日
#$result["thisHour"],當前小時
#$result["thisMin"],當前分鐘
#$result["thisSec"],當前秒數
#必填的參數
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
var_dump(time::getSystemDateAndTime($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::get_RFC822_Time - testCase 1<br>";       
        
/*      
        
#涵式說明:
#回傳目前時間,格式會像這種 Wed, 25 Jan 12 19:13:15 +0800
#必填的參數:
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
var_dump(time::get_RFC822_Time($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getFullDateAndTime - testCase 1<br>";

/*

#回傳西元的目前時間,格式為2010年07月24日15時30分33秒
#必填的參數:
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
        #ex:"Asia/Taipei"
#可省略的參數:
#$conf["showSecond"]="true";#若爲"true"則會顯示秒數     
var_dump(time::getFullDateAndTime($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getDateWithSymbol<br>";

/*

#涵式說明:
#回傳西元的年月日,年月日之間的間隔符號自己設定。
#必填的參數:
$conf["format"]="-";#爲年月日之間的間隔字元
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
        #ex:"Asia/Taipei"
var_dump(time::getDateWithSymbol($conf));
unset($conf);
 
*/
 
#提示目前要測試的涵式
echo"<hr>time::getChtDate - testCase 1<br>";

/*

#涵式說明:
#印出 民國的年月日 例如 100年4月21日
#必填的參數:
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
        #ex:"Asia/Taipei"       
var_dump(time::getChtDate($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getWestDate - testCase 1<br>";

/*

#涵式說明:
#回傳 西元的年月日 例如 2010年4月21日
#必填的參數:
$conf["timeZone"]="Asia/Taipei";#時區代號,可以設定的時區列表:http://www.php.net/manual/en/timezones.php
        #ex:"Asia/Taipei"
var_dump(time::getWestDate($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 1<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-22 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="before";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
#$conf["startTime"]="";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 2<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-22 10:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="before";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
#$conf["startTime"]="";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 3<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-22 10:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="after";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
#$conf["startTime"]="";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 4<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-22 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="after";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
#$conf["startTime"]="";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 5<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-23 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="betweenStartToDeadline";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
$conf["startTime"]="2015-10-21 12:00:00";;
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 6<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-21 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="betweenStartToDeadline";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
$conf["startTime"]="2015-10-23 12:00:00";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 7<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-19 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="betweenStartToDeadline";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
$conf["startTime"]="2015-10-18 12:00:00";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 8<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-19 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="besideStartToDeadline";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
$conf["startTime"]="2015-10-18 12:00:00";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::deadlineAction - testCase 9<br>";

/*

#涵式說明:
#在某段時間之前、後、之內、之未,轉址到某處,若沒有符合條件則回傳"passed"
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$reuslt["error"],執行不正常結束的錯訊息陣列.
#$result["function"],當前執行的函式名稱.
#$result["content"],若沒有符合條件則回傳"passed".
#必填參數:
#$conf["deadline"],字串,爲條件的截止參考時間點,格式須爲 2011-05-27 23:59:59
$conf["deadline"]="2015-10-25 12:00:00";
#$conf["toWhere"],字串,爲要轉址到的地方.
$conf["toWhere"]="https://www.google.com.tw";
#$conf["condition"],字串,爲轉址條件,可以用的值有:"before",代表在某段時間之前;"after",代表在某段時間之後;"betweenStartToDeadline",代表在某段時間之內;"besideStartToDeadline",代表在某段時間之外.
$conf["condition"]="besideStartToDeadline";
#可省略參數:       
#$conf["startTime"],字串,爲條件的開始的參考時間點,格式須爲 2011-05-27 23:59:59 ,適用於 $conf["condtion"] 爲 "betweenStartToDeadline" 或 "besideStartToDeadline".
$conf["startTime"]="2015-10-19 12:00:00";
#$conf["timeZone"],字串,當前時區為何?預設為"Asia/Taipei",可以設定的時區列表:http://www.php.net/manual/en/timezones.php
#$conf["timeZone"]="Asia/Taipei";
var_dump(time::deadlineAction($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::timeToMin - testCase 1<br>";

/*

#涵式說明:
#將時間轉換成用分鐘表示,適用於類似「3H5M15S」轉換成「185.25」的類型,結果會回傳分鐘
#必填的參數:
$conf["stringIn"]="3H5M15S";#爲要分割的字串
$conf["hourSpiltSymbol"]="H";#爲小時的單位代稱
$conf["minSpiltSymbol"]="M";#爲分鐘的單位代稱
$conf["secSpiltSymbol"]="S";#爲秒的單位代稱
var_dump(time::timeToMin($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::timeToMin - testCase 2<br>";

/*

#涵式說明:
#將時間轉換成用分鐘表示,適用於類似「3H5M15S」轉換成「185.25」的類型,結果會回傳分鐘
#必填的參數:
$conf["stringIn"]="3H5M15";#爲要分割的字串
$conf["hourSpiltSymbol"]="H";#爲小時的單位代稱
$conf["minSpiltSymbol"]="M";#爲分鐘的單位代稱
$conf["secSpiltSymbol"]="S";#爲秒的單位代稱
var_dump(time::timeToMin($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::timeToMin - testCase 3<br>";

/*

#涵式說明:
#將時間轉換成用分鐘表示,適用於類似「3H5M15S」轉換成「185.25」的類型,結果會回傳分鐘
#必填的參數:
$conf["stringIn"]="3H5M";#爲要分割的字串
$conf["hourSpiltSymbol"]="H";#爲小時的單位代稱
$conf["minSpiltSymbol"]="M";#爲分鐘的單位代稱
$conf["secSpiltSymbol"]="S";#爲秒的單位代稱
var_dump(time::timeToMin($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getLastMonth - testCase 1<br>";

/*

#涵式說明:
#求算上個月份是幾月
#回傳結果:
#$result["lastMonth"],上個月份
#$result["yearChanged"],若爲true則代表年度要減1,若爲false則年度不變。
#必填的參數:
$conf["thisMonth"]=10;#當前的月份
var_dump(time::getLastMonth($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getLastMonth - testCase 2<br>";

/*

#涵式說明:
#求算上個月份是幾月
#回傳結果:
#$result["lastMonth"],上個月份
#$result["yearChanged"],若爲true則代表年度要減1,若爲false則年度不變。
#必填的參數:
$conf["thisMonth"]=1;#當前的月份
var_dump(time::getLastMonth($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::getLastMonth - testCase 3<br>";

/*

#涵式說明:
#求算上個月份是幾月
#回傳結果:
#$result["lastMonth"],上個月份
#$result["yearChanged"],若爲true則代表年度要減1,若爲false則年度不變。
#必填的參數:
$conf["thisMonth"]=13;#當前的月份
var_dump(time::getLastMonth($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::checkWestYearWhenMonthChanged - testCase 1<br>";

/*

#涵式說明:
#檢查當月份減1的時候,年度是否要減1,並回傳月份減1之後的西元年度。
#回傳的結果:
#$result["yearChanged"],爲年份是否有改變,true表示有改變,false表示沒有改變。
#$result["changedWestYear"],回傳月份減1之後的西元年度。
#必填的參數:
$conf["thisMonth"]=7;#目前的月份
$conf["thisWestYear"]=2013;#目前的西元年。
var_dump(time::checkWestYearWhenMonthChanged($conf));
unset($conf);

*/

#提示目前要測試的涵式
echo"<hr>time::checkWestYearWhenMonthChanged - testCase 2<br>";

/*

#涵式說明:
#檢查當月份減1的時候,年度是否要減1,並回傳月份減1之後的西元年度。
#回傳的結果:
#$result["yearChanged"],爲年份是否有改變,true表示有改變,false表示沒有改變。
#$result["changedWestYear"],回傳月份減1之後的西元年度。
#必填的參數:
$conf["thisMonth"]=1;#目前的月份
$conf["thisWestYear"]=2013;#目前的西元年。
var_dump(time::checkWestYearWhenMonthChanged($conf));
unset($conf);

*/

echo "<hr>time::addTime<p>";

/*

#函式說明:
#將時間往後,n天
#回傳的結果:
#$result["status"],執行是否成功,"true"代表成功;"fasle"代表執行失敗
#$result["error"],錯誤訊息陣列
#$result["year"],修改後的年份
#$result["month"],修改後的月份 
#$result["day"],修改後的日份
#必填的參數:
$conf["delayDays"]="1";#可省略,預設為往後1天
#參考資料來源:
#http://tw1.php.net/manual/en/datetime.add.php
#http://tw1.php.net/manual/en/class.datetime.php
#http://tw1.php.net/manual/en/datetime.format.php
#http://tw1.php.net/manual/en/dateinterval.createfromdatestring.php
#var_dump($timeAddTime=time::addTime($conf));
unset($conf);

*/

echo "<hr>time::computeFebDays - testCase 1 <br>";

/*

#函式說明:
#計算指定的西元年2月是否為閏月,計算2月份有幾天
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列
#$result["content"],"28"代表非閏月,"29"代表閏月.
#必填的參數:
#$conf["year"],字串,要求算2月份有幾天的年份.
$conf["year"]="2000";
var_dump(time::computeFebDays($conf));
unset($conf);

*/

echo "<hr>caculateTimeAmount - testCase 1 <br>";

/*
 
#涵式說明:
#計算時間點距離西元元年多少
#回傳的結果:
#$result["stauts"],執行是否成功,"true"代表執行成功;"false"代表執行失敗
#$result["error"],錯誤訊息陣列
#$result["content"],時間點距離1970/01/01的多少
#必填的參數:
#$conf["dateAndTime"],字串,格式爲 2011-05-27 23:59:59
$conf["dateAndTime"]="2011-05-27 23:59:59";
var_dump(time::caculateTimeAmount($conf));
unset($conf);
 
*/

echo "<hr>time::getMicrotime - testCase 1 <br>";

/*
        
#涵式說明:
#計算時間點距離西元元年多少
#回傳的結果:
#當前時間點距離1970/01/01的多少
var_dump(time::getMicrotime());

*/

echo "<hr>time::addTime - testCase 1 <br>";

/*

#函式說明:
#將時間往後,n天
#回傳的結果:
#$result["stauts"],執行是否成功,"true"代表執行成功;"false"代表執行失敗
#$result["error"],錯誤訊息陣列.
#$result["content"],往後延遲n天後的年月日.            
#$result["year"],修改後的年份.
#$result["month"],修改後的月份. 
#$result["day"],修改後的日份.
#必填的參數:
#$conf["delayDays"],字串,要往後延的天數.
$conf["delayDays"]="1";
#參考資料:
#datetime.add=>http://tw1.php.net/manual/en/datetime.add.php
#class.datetime=>http://tw1.php.net/manual/en/class.datetime.php
#datetime.format=>http://tw1.php.net/manual/en/datetime.format.php
#dateinterval.createfromdatestring=>http://tw1.php.net/manual/en/dateinterval.createfromdatestring.php
var_dump(time::addTime($conf));
unset($conf);
        
*/

echo "<hr>time::computeFebDays - testCase 1 <br>";

/*

#函式說明:
#計算指定的西元年2月是否為閏月,計算2月份有幾天
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列
#$result["content"],"28"代表非閏月,"29"代表閏月.
#必填的參數:
#$conf["year"],字串,要求算2月份有幾天的年份.
$conf["year"]="2015";
var_dump(time::computeFebDays($conf));
unset($conf);

*/

echo "<hr>time::computeFebDays - testCase 2 <br>";

/*

#函式說明:
#計算指定的西元年2月是否為閏月,計算2月份有幾天
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列
#$result["content"],"28"代表非閏月,"29"代表閏月.
#必填的參數:
#$conf["year"],字串,要求算2月份有幾天的年份.
$conf["year"]="2016";
var_dump(time::computeFebDays($conf));
unset($conf);

*/

echo "<hr>time::computeWeekNumber - testCase 1<br>";

/*

#函式說明:
#計算特定年月日為星期幾
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列
#$result["content"],0~6,依序代表星期天到星期六.
#必填的參數:
#$conf["year"],字串,要求算該日為星期幾的所屬年份.
$conf["year"]="2014";
#$conf["month"],字串,要求算該日為星期幾的所屬月份.
$conf["month"]="08";
#$conf["day"],字串,要求算該日為星期幾的日.
$conf["day"]="03";
var_dump(time::computeWeekNumber($conf));
unset($conf);

*/

echo "<hr>time::computeWeekNumber - testCase 2<br>";

/*

#函式說明:
#計算特定年月日為星期幾
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列
#$result["content"],0~6,依序代表星期天到星期六.
#必填的參數:
#$conf["year"],字串,要求算該日為星期幾的所屬年份.
$conf["year"]="2014";
#$conf["month"],字串,要求算該日為星期幾的所屬月份.
$conf["month"]="08";
#$conf["day"],字串,要求算該日為星期幾的日.
$conf["day"]="01";
var_dump(time::computeWeekNumber($conf));
unset($conf);

*/

echo "<hr>time::buildInDate - testCase 1<br>";

/*

#函式說明:
#php內建的date()函數
#回傳的結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列.
#$result["content"],自釘格式的時間字串.
#必填的參數:
#$conf["timeZone"],字串,時區代號,可以設定的時區列表=> http://www.php.net/manual/en/timezones.php 台灣則為"Asia/Taipei".
$conf["timeZone"]="Asia/Taipei";
#$conf["format"],字串,要顯示哪些時間單位,格式與順序為何?
$conf["format"]="Y/m/d(星期D) G:i:s 第W周 時區:e";
var_dump(time::buildInDate($conf));
unset($conf);

*/

echo "<hr>time::getPhpSupportedTimezone - testCase 1<br>";

/*

#說明:
#取得當前系統支援的時區
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列.
#$result["function"],當前執行的函數名稱.
#$result["content"]["timezone"][M]["name"],第M+1個區域的名稱.
#$result["content"]["timezone"][M]["dst"],第M+1個區域是否有用日光節約時間,true代表有;false代表沒有.
#$result["content"]["timezone"][M]["offset"]第M+1個區域資料的時差.
#$result["content"]["offsets"],存在的offset.
#必填參數:
#無.
#可省略參數:
#$conf["strHead"],字串,時區前面的字串,預設為"UTC".
#備註:
#-12的時區來源=>http://php.net/manual/en/timezones.others.php
#建構中...
$conf=array();
$getPhpSupportedTimezone=time::getPhpSupportedTimezone($conf);
unset($conf);

#如果執行失敗
if($getPhpSupportedTimezone["status"]==="false"){
        
        #印出結果
        var_dump($getPhpSupportedTimezone);
        
        #結束執行
        exit;
        
        }#if end

#印出結果
var_dump($getPhpSupportedTimezone);

*/

echo "<hr>time::getPhpSupportedTimezone - testCase 2<br>";

/*

#說明:
#取得當前系統支援的時區
#回傳結果:
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
#$result["error"],錯誤訊息陣列.
#$result["function"],當前執行的函數名稱.
#$result["content"]["timezone"][M]["name"],第M+1個區域的名稱.
#$result["content"]["timezone"][M]["dst"],第M+1個區域是否有用日光節約時間,true代表有;false代表沒有.
#$result["content"]["timezone"][M]["offset"]第M+1個區域資料的時差.
#$result["content"]["offsets"],存在的offset.
#必填參數:
#無.
#可省略參數:
#$conf["strHead"],字串,時區前面的字串,預設為"UTC".
$conf["strHead"]="";
#備註:
#-12的時區來源=>http://php.net/manual/en/timezones.others.php
#建構中...
$getPhpSupportedTimezone=time::getPhpSupportedTimezone($conf);
unset($conf);

#如果執行失敗
if($getPhpSupportedTimezone["status"]==="false"){
        
        #印出結果
        var_dump($getPhpSupportedTimezone);
        
        #結束執行
        exit;
        
        }#if end

#印出結果
var_dump($getPhpSupportedTimezone);

*/

?>