for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Chrisyue\PhpM3u8\DataTransformer;
class Iso8601Transformer
{
public function fromString($string)
return new \DateTime($string);
}
public function toString(\DateTime $datetime):string
$timezone = $datetime->format('P');
return sprintf('%s%s', substr($datetime->format('Y-m-d\TH:i:s.u'), 0, -3), $timezone);