On this page
  1. ssl.cert_time_to_seconds
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

ssl.cert_time_to_seconds

Prev: ssl.AlertDescription | Up: ssl | Next: ssl.CertificateError
Rel: ssl.AlertDescription, ssl.CertificateError, ssl.create_connection, ssl.create_default_context
Ref: docs.python.org — ssl.cert_time_to_seconds
Tags: #public #python3 #stdlib #ssl


Import

import ssl
from ssl import cert_time_to_seconds

Signature & Overview

ssl.cert_time_to_seconds(cert_time)

Return the time in seconds since the Epoch, given the timestring representing the "notBefore" or "notAfter" date from a certificate in "%b %d %H:%M:%S %Y %Z" strptime format (C locale).

Usage

import ssl

ts = ssl.cert_time_to_seconds("Jan  1 00:00:00 2026 GMT")
assert isinstance(ts, int) and ts > 1_700_000_000

Gotchas

REPL Inspect

from ssl import cert_time_to_seconds
help(cert_time_to_seconds)

Linked from

Related notes