(Java) Transition from Email.GetDt to Email.EmailDateStr
Provides instructions for replacing deprecated GetDt method calls with EmailDateStr. Note: This example requires Chilkat v11.0.0 or greater.
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[])
{
CkEmail email = new CkEmail();
// ...
// ...
// ------------------------------------------------------------------------
// The GetDt method is deprecated:
CkDateTime dateTimeObj = email.GetDt();
if (email.get_LastMethodSuccess() == false) {
System.out.println(email.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EmailDateStr.
CkDateTime dt = new CkDateTime();
dt.SetFromRfc822(email.emailDateStr());
}
}
|