Fix the End time and expiry calculation

This commit is contained in:
John Crisp
2020-02-21 12:19:20 +01:00
parent bb58c48837
commit 1b06a7e1c3

View File

@@ -353,12 +353,12 @@ function CAdb_explode_entry($dbentry) {
} }
sscanf(CA_cert_startdate($a[3]),"%s %s %s %s", $mm,$dd,$tt,$yy); sscanf(CA_cert_startdate($a[3]),"%s %s %s %s", $mm,$dd,$tt,$yy);
$db['issued'] = strftime("%y-%b-%d", strtotime("$dd $mm $yy")); $db['issued'] = strftime("%Y-%b-%d", strtotime("$yy-$mm-$dd"));
sscanf($a[1], "%2s%2s%2s",$yy,$mm,$dd); sscanf(CA_cert_enddate($a[3]), "%s %s %s %s",$mm,$dd,$tt,$yy);
$db['expires'] = strftime("%y-%b-%d", strtotime("$mm/$dd/$yy")); $db['expires'] = strftime("%Y-%b-%d", strtotime("$yy-$mm-$dd"));
if (time() > strtotime("$mm/$dd/$yy")) if (time() > strtotime("$mm-$dd-$yy"))
$db['status'] = "Expired"; $db['status'] = "Expired";
$db['serial'] = $a[3]; $db['serial'] = $a[3];