{"id":553,"date":"2011-10-10T14:12:20","date_gmt":"2011-10-10T18:12:20","guid":{"rendered":"http:\/\/cfdbplugin.com\/?page_id=553"},"modified":"2014-10-18T19:18:10","modified_gmt":"2014-10-18T23:18:10","slug":"filtering-submit_time","status":"publish","type":"page","link":"https:\/\/cfdbplugin.com\/?page_id=553","title":{"rendered":"Filtering submit_time"},"content":{"rendered":"<p>As of version 2.2, filtering can be done relative to the current time. This is in response to people wanting to get &#8220;all submission in the last week&#8221; for example.<\/p>\n<p>Do this using &#8220;submit_time&#8221; in the filter. The\u00a0submit_time is a Unix time stamp of when a submission was received. You can use a raw timestamp like:<\/p>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;1318262984<\/span>\"]<\/pre>\n<p>But these timestamp values are hard for a human to compute and understand. Now you can use:<\/p>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;October 10, 2011<\/span>\"]<\/pre>\n<p>Or you can use a time <strong>relative to today<\/strong>.<br \/>\nExamples:<\/p>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;last week<\/span>\"]<\/pre>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;last Friday<\/span>\"]<\/pre>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;-1 week 2 days 4 hours 2 seconds<\/span>\"]<\/pre>\n<p>These kinds of <strong>English descriptions<\/strong> of time are parsed based on the <a title=\"strtotime\" href=\"http:\/\/www.php.net\/manual\/en\/function.strtotime.php\" target=\"_blank\">PHP strtotime function<\/a>.<\/p>\n<p>To search <strong>between dates<\/strong>, use &amp;&amp; (see more on <a href=\"http:\/\/cfdbplugin.com\/?page_id=89#filter\">filter<\/a>)<\/p>\n<pre>[cfdb-table form=\"Contact form\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;2013-03-15&amp;&amp;submit_time&lt;2013-03-25<\/span>\"]<\/pre>\n<p><strong>Don&#8217;t Make Easy Mistakes<\/strong><\/p>\n<p>Do you know what is wrong with this? You think it is going to get values from the last week but it does not.<\/p>\n<pre>[cfdb-table form=\"form1\" filter=\"<span style=\"color: #ff0000;\">submit_time&gt;1 week<\/span>\"] <span style=\"color: #ff0000;\"><strong>WRONG!<\/strong><\/span><\/pre>\n<div>&#8220;1 week&#8221; is interpreted as one week from today. &#8220;submit_time&gt;1 week&#8221; means submissions received one week in the future. \u00a0So of course it shows nothing!<\/div>\n<pre>[cfdb-table form=\"form1\" filter=\"<span style=\"font-weight: bold; background-color: #ffff99;\">submit_time&gt;-1 week<\/span>\"] <strong>RIGHT!<\/strong><\/pre>\n<p>Use &#8220;-&#8221; to indicate &#8220;now &#8211; 1 week in the past&#8221;.<\/p>\n<p><strong>Don&#8217;t get Confused About Greater-than and Less-than<\/strong><\/p>\n<ul>\n<li>Greater-than mean &#8220;more recent than&#8221;<\/li>\n<li>Less-than mean &#8220;before&#8221;<\/li>\n<\/ul>\n<p>If you have something like &#8220;submit_time&gt;4 weeks ago&#8221; that does NOT mean older than 4 weeks ago, it means you are looking for submissions with submit_time greater than (more recent than) 4 weeks ago.<\/p>\n<p><strong>\u00a0Check it<\/strong><\/p>\n<p>To check if your English time description works, go to the Shortcode builder page, in the filter section select &#8220;submit_time&#8221;, enter a value and click &#8220;Validate submit_time&#8221;. It will tell you exactly what day and time your value resolves to.<\/p>\n<p><a href=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2011\/10\/filter-submit_time.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-561\" title=\"filter submit_time\" alt=\"\" src=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2011\/10\/filter-submit_time.png\" width=\"741\" height=\"124\" srcset=\"https:\/\/cfdbplugin.com\/wp-content\/uploads\/2011\/10\/filter-submit_time.png 741w, https:\/\/cfdbplugin.com\/wp-content\/uploads\/2011\/10\/filter-submit_time-300x50.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of version 2.2, filtering can be done relative to the current time. This is in response to people wanting to get &#8220;all submission in the last week&#8221; for example. Do this using &#8220;submit_time&#8221; in the filter. The\u00a0submit_time is a Unix time stamp of when a submission was received. You can use a raw timestamp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1069,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"page-without-sidebar.php","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-553","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1mptf-8V","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=553"}],"version-history":[{"count":21,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/553\/revisions"}],"predecessor-version":[{"id":1071,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/553\/revisions\/1071"}],"up":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1069"}],"wp:attachment":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}