Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use DateTime for timestamp conversion from 'yymmddhhiiss'#131

Open
erikn69 wants to merge 2 commits intodealfonso:main from
erikn69:patch-25
Open

Use DateTime for timestamp conversion from 'yymmddhhiiss' #131
erikn69 wants to merge 2 commits intodealfonso:main from
erikn69:patch-25

Conversation

@erikn69
Copy link
Contributor

@erikn69 erikn69 commented Jan 21, 2026
edited
Loading

Closes #129

The asn1::utime() function in src/helpers/asn1.php expects a date with yymmddhhiiss format,
but date() 2nd arg expects Unix timestamp (?int) as input:
date(string $format, ?int $timestamp = null): string php.net/function.date.php

if($func == 'utime') {
 $time = $params[0]; //yymmddhhiiss
 $oldTz = date_default_timezone_get();
 date_default_timezone_set("UTC");
 $time = date("ymdHis", $time); // <-- Expects $time to be Unix timestamp, gets yymmddhhiiss string
 date_default_timezone_set($oldTz);
 $val = bin2hex($time."Z");
}
asn1::utime(date("ymdHis")) //UTTC Time

sapp/src/helpers/asn1.php

Lines 233 to 236 in 2e8a56c

$time = $params[0]; //yymmddhhiiss
$oldTz = date_default_timezone_get();
date_default_timezone_set("UTC");
$time = date("ymdHis", $time);

Replace date function with DateTime for timestamp conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[CRITICAL] Digital signatures fail validation - Invalid SigningTime in CMS/PKCS#7 structure

1 participant

AltStyle によって変換されたページ (->オリジナル) /