Skip to content

Commit

Permalink
fix: created ts according to xml schema datetime spec
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
  • Loading branch information
dbluhm committed Dec 7, 2023
1 parent a6c3418 commit fbcbdeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ async def create_proof(
date = self.date or datetime.now(timezone.utc)
if not date.tzinfo:
date = utc.localize(date)
proof["created"] = date.isoformat()
proof["created"] = (
date.replace(tzinfo=None).isoformat(timespec="seconds") + "Z"
)

# Allow purpose to update the proof; the `proof` is in the
# SECURITY_CONTEXT_URL `@context` -- therefore the `purpose` must
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ async def create_proof(
date = self.date or datetime.now(timezone.utc)
if not date.tzinfo:
date = utc.localize(date)
proof["created"] = date.isoformat()
proof["created"] = (
date.replace(tzinfo=None).isoformat(timespec="seconds") + "Z"
)

# Allow purpose to update the proof; the `proof` is in the
# SECURITY_CONTEXT_URL `@context` -- therefore the `purpose` must
Expand Down

0 comments on commit fbcbdeb

Please sign in to comment.