Sample code for 30+ languages & platforms
VBScript

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

set cert = CreateObject("Chilkat.Cert")

' ------------------------------------------------------------------------
' The GetValidToDt method is deprecated:

' ckdt1 is a Chilkat.CkDateTime
Set ckdt1 = cert.GetValidToDt()
If (cert.LastMethodSuccess = 0) Then
    outFile.WriteLine(cert.LastErrorText)
    WScript.Quit
End If

' ...
' ...

' ------------------------------------------------------------------------
' Do the equivalent using the ValidToStr property

set ckdt2 = CreateObject("Chilkat.CkDateTime")
success = ckdt2.SetFromRfc822(cert.ValidToStr)

outFile.Close