Sample code for 30+ languages & platforms
Java

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    CkCert cert = new CkCert();

    //  ------------------------------------------------------------------------
    //  The GetValidToDt method is deprecated:

    CkDateTime ckdt1 = cert.GetValidToDt();
    if (cert.get_LastMethodSuccess() == false) {
        System.out.println(cert.lastErrorText());
        return;
        }

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  Do the equivalent using the ValidToStr property

    CkDateTime ckdt2 = new CkDateTime();
    ckdt2.SetFromRfc822(cert.validToStr());
  }
}