change strategy for Time class

This commit is contained in:
Mike Macgirvin 2024-03-09 21:42:27 +11:00
parent dbd76f879b
commit ac7c1d497b
2 changed files with 2 additions and 7 deletions

View file

@ -21,7 +21,7 @@ class JcsEddsa2022
$options = [
'type' => 'DataIntegrityProof',
'cryptosuite' => 'eddsa-jcs-2022',
'created' => new Time(format: ATOM_TIME),
'created' => Time::convert(format: ATOM_TIME),
'verificationMethod' => Channel::url($channel) . '#' . $pubkey,
'proofPurpose' => 'assertionMethod',
];

View file

@ -8,12 +8,7 @@ use Exception;
class Time
{
protected $from = 'UTC';
protected $to = 'UTC';
protected $datetime;
protected $format;
public function __construct($from = 'UTC', $to = 'UTC', $datetime = 'now', $format = "Y-m-d H:i:s")
public static function convert($from = 'UTC', $to = 'UTC', $datetime = 'now', $format = "Y-m-d H:i:s")
{
// Defaults to UTC if nothing is set, but throws an exception if set to empty string.