(response)
return datetime.datetime.fromtimestamp(response, tz)
Convert a Stripe API timestamp response (unix epoch) to a native datetime.
Convert a Stripe API timestamp response (unix epoch) to a native datetime.
Convert a Stripe API timestamp response ( unix epoch ) to a native datetime .
def convert_tstamp(response) -> Optional[datetime.datetime]:
    """
    Convert a Stripe API timestamp response (unix epoch) to a native datetime.
    """
    if response is None:
        # Allow passing None to convert_tstamp()
        return response

    # Overrides the set timezone to UTC - I think...
    tz = timezone.utc if settings.USE_TZ else None

    return datetime.datetime.fromtimestamp(response, tz)
def convert_tstamp ( response ) -> Optional [ datetime . datetime ] : if response is None : # Allow passing None to convert_tstamp() return response # Overrides the set timezone to UTC - I think... tz = timezone . utc if settings . USE_TZ else None return datetime . datetime . fromtimestamp ( response , tz )