Title: Comparing custom datetime field
Last modified: September 19, 2018

---

# Comparing custom datetime field

 *  Resolved [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/comparing-custom-datetime-field/)
 * I’m trying to display some text, depending on whether a datetime field is in 
   the past.
 *     ```
       [pass field=wpcf-date in=timestamp]
         [if pass='{FIELD}' value=past-time]
           CONCERT ENDED
         [else]
           Coming soon. Stored={FIELD} Now=[today format=U]
         [/if]
       [/pass]
       ```
   
 * The IF condition never seems to evaluate as true, and always displays “Coming
   soon”. I’ve tried numerous options, but am missing something obvious. Can anyone
   help.
 * The wpcf-date field is from Toolset types, and works most other places I have
   used it. Typical output:
    `Coming soon. Stored=1506535200 Now=1537383865`
 * `Coming soon. Stored=1537988400 Now=1537384236`
    -  This topic was modified 7 years, 8 months ago by [iantresman](https://wordpress.org/support/users/iantresman/).
    -  This topic was modified 7 years, 8 months ago by [iantresman](https://wordpress.org/support/users/iantresman/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/comparing-custom-datetime-field/#post-10707148)
 * I think I’ve solved the problem, which I had over complicated. The solution is
   to remove the [pass] field:
 * [if field=wpcf-date value=past-time in=timestamp]
    CONCERT ENDED [else] Coming
   soon. [/if]

Viewing 1 replies (of 1 total)

The topic ‘Comparing custom datetime field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [iantresman](https://wordpress.org/support/users/iantresman/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/comparing-custom-datetime-field/#post-10707148)
 * Status: resolved