Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

cert = chilkat2.Cert()

# ------------------------------------------------------------------------
# The GetValidToDt method is deprecated:

# ckdt1 is a CkDateTime
ckdt1 = cert.GetValidToDt()
if (cert.LastMethodSuccess == False):
    print(cert.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using the ValidToStr property

ckdt2 = chilkat2.CkDateTime()
ckdt2.SetFromRfc822(cert.ValidToStr)