diff --git a/Code/Lib/JcsEddsa2022.php b/Code/Lib/JcsEddsa2022.php index efa4f8a92..f8679a2e7 100644 --- a/Code/Lib/JcsEddsa2022.php +++ b/Code/Lib/JcsEddsa2022.php @@ -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', ]; diff --git a/Code/Lib/Time.php b/Code/Lib/Time.php index 7547eb96d..34282f766 100644 --- a/Code/Lib/Time.php +++ b/Code/Lib/Time.php @@ -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.