Sample code for 30+ languages & platforms
PureBasic Requires Chilkat v11.0.0+

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkDateTime.pb"
IncludeFile "CkCert.pb"

Procedure ChilkatExample()

    cert.i = CkCert::ckCreate()
    If cert.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ;  ------------------------------------------------------------------------
    ;  The GetValidToDt method is deprecated:

    ckdt1.i = CkCert::ckGetValidToDt(cert)
    If CkCert::ckLastMethodSuccess(cert) = 0
        Debug CkCert::ckLastErrorText(cert)
        CkCert::ckDispose(cert)
        ProcedureReturn
    EndIf

    ;  ...
    ;  ...

    CkDateTime::ckDispose(ckdt1)

    ;  ------------------------------------------------------------------------
    ;  Do the equivalent using the ValidToStr property

    ckdt2.i = CkDateTime::ckCreate()
    If ckdt2.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkDateTime::ckSetFromRfc822(ckdt2,CkCert::ckValidToStr(cert))


    CkCert::ckDispose(cert)
    CkDateTime::ckDispose(ckdt2)


    ProcedureReturn
EndProcedure