【文件属性】:
文件名称:PHP-Dev-Interview-Date-Test:测试要求压缩并作为公司面试过程的一部分发送
文件大小:4KB
文件格式:ZIP
更新时间:2021-07-05 14:24:24
PHP
PHP测试
在不使用任何内置 PHP 日期函数或对象的情况下计算两个给定日期之间的差异。
假设
日期将以“YYYY/MM/DD”格式提供,例如“2015/03/21”。
所有日期都将基于公历。
应该有一个用于计算格式差异的接口:
$ difference = MyDate :: diff ( $ start , $ end );
返回值应该是以下格式的对象:
stdClass {
int $ years , // The number of years between the two dates.
int $ months , // The number of years between the two dates.
int $ days , // The number of days between
【文件预览】:
PHP-Dev-Interview-Date-Test-master
----src()
--------MyDate.php(277B)
--------autoload.php(325B)
----README.md(2KB)
----contributors.txt(13B)
----tests()
--------MyDateTest.php(4KB)
----composer.json(66B)