1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 05:54:55 +00:00

Fix ISO 8601 format strings

This commit is contained in:
J. King 2017-07-09 18:31:03 -04:00
parent 4992b2c669
commit eacada3982
2 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ trait DateFormatter {
if($outFormat=="unix") return $date->getTimestamp(); if($outFormat=="unix") return $date->getTimestamp();
switch ($outFormat) { switch ($outFormat) {
case 'http': $f = "D, d M Y H:i:s \G\M\T"; break; case 'http': $f = "D, d M Y H:i:s \G\M\T"; break;
case 'iso8601': $f = "Y-m-dTH:i:s"; break; case 'iso8601': $f = "Y-m-d\TH:i:s"; break;
case 'sql': $f = "Y-m-d H:i:s"; break; case 'sql': $f = "Y-m-d H:i:s"; break;
case 'date': $f = "Y-m-d"; break; case 'date': $f = "Y-m-d"; break;
case 'time': $f = "H:i:s"; break; case 'time': $f = "H:i:s"; break;
@ -34,7 +34,7 @@ trait DateFormatter {
if(!is_null($inFormat)) { if(!is_null($inFormat)) {
switch($inFormat) { switch($inFormat) {
case 'http': $f = "D, d M Y H:i:s \G\M\T"; break; case 'http': $f = "D, d M Y H:i:s \G\M\T"; break;
case 'iso8601': $f = "Y-m-dTH:i:sP"; break; case 'iso8601': $f = "Y-m-d\TH:i:sP"; break;
case 'sql': $f = "Y-m-d H:i:s"; break; case 'sql': $f = "Y-m-d H:i:s"; break;
case 'date': $f = "Y-m-d"; break; case 'date': $f = "Y-m-d"; break;
case 'time': $f = "H:i:s"; break; case 'time': $f = "H:i:s"; break;

View file

@ -25,8 +25,8 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
} }
function assertTime($exp, $test) { function assertTime($exp, $test) {
$exp = $this->dateTransform($exp, "unix"); $exp = $this->dateTransform($exp, "iso8601");
$test = $this->dateTransform($test, "unix"); $test = $this->dateTransform($test, "iso8601");
$this->assertSame($exp, $test); $this->assertSame($exp, $test);
} }