It returns string, should I convert this to integer and then compare with strtotime(date('Y-m-d')) or there is another method to get the value of custom date field? Please advise the best practice in comparing the date.
Hello. Thank you for contacting the Toolset support.
Toolset Types custom date field stores the value to database as Unix Timestamp that is why when you fetch the value of the field from database using the WordPress native function get_post_meta() for the field "uprise-first-bill-date" it return you timestamp.
So to compare the current time:
$firstBillDate = get_post_meta( $post_id, "wpcf-uprise-first-bill-date", true);
if($firstBillDate > time() ) {
echo "bill date is in future";
}else{
echo "bill date is passed";
}
You should not worry about that, the if condition I shared should work.
$firstBillDate = get_post_meta( $post_id, "wpcf-uprise-first-bill-date", true);
if($firstBillDate > time() ) {
echo "bill date is in future";
}else{
echo "bill date is passed";
}