예제 #1
0
    }
    printf("%s INFO - Testing UTC/Local conversions [1/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->utc2local();
    $refb = $spotnab->utc2local($spotnab->local2utc($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
    printf("%s INFO - Testing UTC/Local conversions [2/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->local2utc();
    $refb = $spotnab->local2utc($spotnab->utc2local($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
    printf("%s INFO - Testing UTC/Local conversions [3/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->local2utc(date("Y-m-d H:i:s"));
    $refb = $spotnab->local2utc($spotnab->utc2local($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
    printf("%s INFO - Testing UTC/Local conversions [4/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->utc2local(time());
    $refb = $spotnab->utc2local($spotnab->local2utc($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
    printf("%s INFO - Testing UTC/Local conversions [5/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->local2utc(time());
    $refb = $spotnab->local2utc($spotnab->utc2local($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
    printf("%s INFO - Testing UTC/Local conversions [6/6]...", date("Y-m-d H:i:s"));
    $refa = $spotnab->utc2local(gmdate("Y-m-d H:i:s"));
    $refb = $spotnab->utc2local($spotnab->local2utc($refa));
    echo $refa == $refb ? "Successful!\n" : "Failed!\n";
}
if (array_key_exists("o", $options) || array_key_exists("clean-orphan-comments", $options)) {
    echo "Removing orphan comments...";
    $spotnab = new SpotNab();
    printf("%d record(s) removed.\n", $spotnab->orphan_comment_clean());
}