diff --git a/epp/src/epp-create.php b/epp/src/epp-create.php index b3e9564..00fa364 100644 --- a/epp/src/epp-create.php +++ b/epp/src/epp-create.php @@ -1576,8 +1576,8 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m ':tm_phase' => $launch_phase ?? 'none', ':tm_smd_id' => $smd_encodedSignedMark ?? null, ':tm_notice_id' => $noticeid ?? null, - ':tm_notice_accepted' => $accepted ?? null, - ':tm_notice_expires' => $notafter ?? null + ':tm_notice_accepted' => normalizeDatetime($accepted) ?? null, + ':tm_notice_expires' => normalizeDatetime($notafter) ?? null ]); $domain_id = $db->lastInsertId(); diff --git a/epp/src/helpers.php b/epp/src/helpers.php index b6a0916..fbfd784 100644 --- a/epp/src/helpers.php +++ b/epp/src/helpers.php @@ -1057,4 +1057,9 @@ function ipMatches($ip, $cidr) { $maskBin = pack("H*", $maskBin); return ($ipBin & $maskBin) === ($subnetBin & $maskBin); +} + +function normalizeDatetime($input) { + $dt = DateTime::createFromFormat(DateTime::ATOM, $input); // handles 'T' and 'Z' + return $dt ? $dt->format('Y-m-d H:i:s.v') : null; // .v gives milliseconds } \ No newline at end of file