How to determine whether an ad has expired
Given the post_id of a given ad, you can determine whether that ad has expired by executing the following code:
$ad_has_expired = ( current_time('timestamp') > strtotime( get_post_meta( $post_id, 'cp_sys_expire_date', true ) ) ) ? TRUE : FALSE;
The code causes the processor to compare the current real-world date/time to the ad's expiration date/time, and sets the variable $ad_has_expired to TRUE if the current real-world date/time is past the ad's expiration date/time. You can use this test when deciding whether to display an "EXPIRED" badge, etc.
- - - Updated - - -
I don't know why I can't use newlines in my posts. Does anyone else have that problem? I think I'd submit more tutorials if I could format them the way I want (e.g. with vertical spacing).