Skip to content

Commit 08bf7ae

Browse files
committed
New DateTime type that supports Constant Contact datetime format via __toString
1 parent 74b39ee commit 08bf7ae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ConstantContact/DateTime.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace PHPFUI\ConstantContact;
4+
5+
/**
6+
* Simple Date class for JSON output
7+
*/
8+
class DateTime extends \DateTime
9+
{
10+
public function __toString() : string
11+
{
12+
return $this->format(\DateTimeInterface::ATOM);
13+
}
14+
}

0 commit comments

Comments
 (0)