{"id":1483,"date":"2014-08-14T13:21:30","date_gmt":"2014-08-14T11:21:30","guid":{"rendered":"https:\/\/chapmanbright.com\/?post_type=resources&#038;p=1483"},"modified":"2025-11-17T12:42:24","modified_gmt":"2025-11-17T11:42:24","slug":"marketo-math-with-dates-a-webhook-solution","status":"publish","type":"resources","link":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/","title":"Marketo: Math with dates? A Webhook Solution!","content":{"rendered":"","protected":false},"parent":0,"template":"","cb_resources_category":[91],"class_list":["post-1483","resources","type-resources","status-publish","hentry","cb_resources_category-other"],"acf":{"banner":3959,"title":"Marketo: Math with dates? A Webhook Solution!","text_overview":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo. At least not now, when I'm writing the blogpost.","image":3959,"button":"","components":[{"acf_fc_layout":"layout_textblock_full","background":"grey-light","title":"","text":"<em>This article reflects Chapman Bright\u2019s earlier focus on Marketo and 'classical' marketing automation.\r\nToday we help B2B companies scale productivity with automation, AI, and agents. <a href=\"\/services\/pillars\/\">Read more<\/a><\/em>","button":null},{"acf_fc_layout":"layout_textblock_full","background":"none","title":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours.","text":"<strong>Whilst this is possible in Salesforce, it's not possible in Marketo. At least not now, when I'm writing the blogpost.<\/strong>\r\n\r\nSolution? Write your own calculation script (in PHP) and take full advantage of the Marketo Webhook functionality. But first; Make sure you know, what you need to know, about <a title=\"Marketo Webhooks\" href=\"http:\/\/developers.marketo.com\/documentation\/webhooks\/\" target=\"_blank\" rel=\"noopener\">Marketo Webhooks<\/a>.\r\n\r\n<strong>Step 1.<\/strong> Write a simple script in PHP to substract dates. Place it on a server through FTP. Here is the script I use to get the amount of days:\r\n\r\n<em>&lt;?php header(\"Content-type: text\/xml\"); <\/em>\r\n<em>echo '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;';<\/em>\r\n<em>echo '&lt;note&gt;';<\/em>\r\n<em>echo'\u00a0\u00a0 \u00a0&lt;days&gt;'; $start = strtotime($_GET['start']); $end = strtotime($_GET['end']); $seconds = $end - $start; $days = round(($seconds\/60\/60\/24)+1); echo $days; echo '&lt;\/days&gt;';<\/em>\r\n<em>echo'\u00a0\u00a0 \u00a0&lt;weeks&gt;'; $weeks = ceil($days\/7); echo $weeks; echo '&lt;\/weeks&gt;';<\/em>\r\n<em>echo '&lt;\/note&gt;'; ?&gt;<\/em>\r\n\r\nThe script above outputs in XML, when you call the URL like this: http:\/\/www.diederikmartens.com\/XXXXXXXteapi.php?start=2014-01-01&amp;end=2014-01-31.\r\n\r\n<strong>Step 2.<\/strong> Now we are ready to set up the webhook in Marketo. First start with creating your new field in Marketo that will hold date amount of days (or weeks).\r\n\r\n<strong>UPDATE<\/strong>\r\nYou don\u2019t have to be a coding guru to pull this off! CALCITNOW allows you to create formulas on the fly. You can acquire a CALCITNOW license at <a href=\"http:\/\/www.smops-soft.com\/calcitnow\" rel=\"nofollow\">http:\/\/www.smops-soft.com\/calcitnow<\/a>. Please note that you will need to create a free SMOps account first, in order to acquire licenses.\r\n\r\nIf you have any questions, just leave them below this post.\r\n\r\n&nbsp;","button":null},{"acf_fc_layout":"layout_title","title":"Some extra resource suggestions for you","subtitle":"by our content recommendation engine"},{"acf_fc_layout":"rtp","title":"You might also be interested in","categories":["Blog"],"template":"template1"},{"acf_fc_layout":"layout_cta","title":"Want to know more about creating forumlas?","subtitle":"We can help with that!","button":{"title":"Get in touch","url":"https:\/\/chapmanbright.com\/contact\/","target":""}}]},"acfml_non_translatable_locations":null,"_yoast_wpseo_primary_cb_chaploop_category":null,"_yoast_wpseo_primary_category":null,"_yoast_wpseo_primary_cb_resources_category":"","_oembed_93c4ee9e07cccdbab2160d89f51e0593":null,"_oembed_time_93c4ee9e07cccdbab2160d89f51e0593":null,"_oembed_895c57a59179d1bdcc0438a6aef65717":null,"_oembed_time_895c57a59179d1bdcc0438a6aef65717":null,"_oembed_a76e0da45bf1cb4c09bc985b193bb36b":null,"_oembed_time_a76e0da45bf1cb4c09bc985b193bb36b":null,"_oembed_d471c06fe0867c32a7c3cd67b5476e72":null,"_oembed_time_d471c06fe0867c32a7c3cd67b5476e72":null,"_oembed_3e251453af4bbbd696536d0acadba70c":null,"_oembed_time_3e251453af4bbbd696536d0acadba70c":null,"_oembed_609a8aa9fc83eb054ff7bc4d33a77773":null,"_oembed_time_609a8aa9fc83eb054ff7bc4d33a77773":null,"_oembed_69e7431aa03b88885898bf8bb28fb3a2":null,"_oembed_time_69e7431aa03b88885898bf8bb28fb3a2":null,"_oembed_1a7070c378b395415af4a19fb20df21e":null,"_oembed_time_1a7070c378b395415af4a19fb20df21e":null,"_oembed_55d4298c0fe3b359fd893e8424afe5ff":null,"_oembed_time_55d4298c0fe3b359fd893e8424afe5ff":null,"_oembed_f9c03bd9872da4d01788e5fab78083b5":null,"_oembed_time_f9c03bd9872da4d01788e5fab78083b5":null,"_oembed_ed31fabb7dfe0fd87fcb196f605adf8a":null,"_oembed_time_ed31fabb7dfe0fd87fcb196f605adf8a":null,"_oembed_f06b7516090267ff536179713f17601d":null,"_oembed_time_f06b7516090267ff536179713f17601d":null,"_oembed_e410f7495d0eaf4554919b3e5f478077":null,"_oembed_72a013d9dd3f2322671bc171fe3158ee":null,"_oembed_940f9a7b80afb0cbcc3ba55ead955b1e":null,"_oembed_06caf10aa2f40e07a7dc241ec9381e32":null,"_oembed_time_06caf10aa2f40e07a7dc241ec9381e32":null,"_oembed_3b19edfaec2ee2d35e9b030ef998c63e":null,"_oembed_time_3b19edfaec2ee2d35e9b030ef998c63e":null,"_oembed_4dbf01cda5d7c2b1d4e613889ea0ea41":null,"_oembed_790b310b2853f889f44a51704e8e43db":null,"_oembed_de0c2f3a9e579d82d9ba59d46c7d6f13":null,"_oembed_time_de0c2f3a9e579d82d9ba59d46c7d6f13":null,"_oembed_f6e83cecc2e9acb7d1ef17990035200a":null,"_oembed_time_f6e83cecc2e9acb7d1ef17990035200a":null,"_oembed_37f9de01864257564c01942ac642dd0a":null,"_oembed_time_37f9de01864257564c01942ac642dd0a":null,"_oembed_bb413565e8d54f815c41cfcbf8544000":null,"_oembed_time_bb413565e8d54f815c41cfcbf8544000":null,"_oembed_01c508667543a073acaa932efa5f40c3":null,"_oembed_time_01c508667543a073acaa932efa5f40c3":null,"_oembed_04cd44f1f3f9be9b6faab34a598e255f":null,"_oembed_time_04cd44f1f3f9be9b6faab34a598e255f":null,"_oembed_df22d986c96061734fee19868cf88af0":null,"_oembed_time_df22d986c96061734fee19868cf88af0":null,"_oembed_e10bab5640f3efd1a065332325fa1451":null,"banner":"106","_banner":"field_5c7651d015c5c","_title":"field_5c7651d015e12","components":["layout_textblock_full","layout_textblock_full","layout_title","rtp","layout_cta"],"_components":"field_5c61508b6fb90","_yoast_wpseo_focuskw":"Marketo","_yoast_wpseo_title":null,"_yoast_wpseo_metadesc":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo.","text_overview":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo. At least not now, when I'm writing the blogpost.","_text_overview":"field_5c7651d015fe3","subtitle":null,"_subtitle":null,"logo":null,"_logo":null,"image":"106","_image":"field_5c7651f47d2e1","button":null,"_button":null,"components_4_categories":null,"_components_4_categories":null,"text_intro":null,"_text_intro":null,"frontpage_image":null,"_frontpage_image":null,"event_date_day":null,"_event_date_day":null,"image_link":null,"_image_link":null,"_yoast_wpseo_opengraph-image":null,"_yoast_wpseo_opengraph-image-id":null,"_yoast_wpseo_twitter-image":null,"_yoast_wpseo_twitter-image-id":null,"_yoast_wpseo_opengraph-title":null,"_yoast_wpseo_opengraph-description":null,"_yoast_wpseo_twitter-title":null,"_yoast_wpseo_twitter-description":null,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Marketo: Math with dates? A Webhook Solution! - Chapman Bright<\/title>\n<meta name=\"description\" content=\"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it&#039;s not possible in Marketo.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Marketo: Math with dates? A Webhook Solution! - Chapman Bright\" \/>\n<meta property=\"og:description\" content=\"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it&#039;s not possible in Marketo.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/\" \/>\n<meta property=\"og:site_name\" content=\"Chapman Bright\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-17T11:42:24+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@chapmanbright\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/\",\"url\":\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/\",\"name\":\"Marketo: Math with dates? A Webhook Solution! - Chapman Bright\",\"isPartOf\":{\"@id\":\"https:\/\/chapmanbright.com\/nl\/#website\"},\"datePublished\":\"2014-08-14T11:21:30+00:00\",\"dateModified\":\"2025-11-17T11:42:24+00:00\",\"description\":\"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo.\",\"breadcrumb\":{\"@id\":\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/chapmanbright.com\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/chapmanbright.com\/nl\/resources\/%resource%\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Marketo: Math with dates? A Webhook Solution!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/chapmanbright.com\/nl\/#website\",\"url\":\"https:\/\/chapmanbright.com\/nl\/\",\"name\":\"Chapman Bright\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/chapmanbright.com\/nl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/chapmanbright.com\/nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/chapmanbright.com\/nl\/#organization\",\"name\":\"Chapman Bright\",\"url\":\"https:\/\/chapmanbright.com\/nl\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/chapmanbright.com\/nl\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/chapmanbright.com\/wp-content\/uploads\/2019\/03\/logo_chapmanbright_colour_RGB.png\",\"contentUrl\":\"https:\/\/chapmanbright.com\/wp-content\/uploads\/2019\/03\/logo_chapmanbright_colour_RGB.png\",\"width\":2000,\"height\":338,\"caption\":\"Chapman Bright\"},\"image\":{\"@id\":\"https:\/\/chapmanbright.com\/nl\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/chapmanbright\",\"https:\/\/www.linkedin.com\/company\/chapman-bright\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Marketo: Math with dates? A Webhook Solution! - Chapman Bright","description":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/","og_locale":"nl_NL","og_type":"article","og_title":"Marketo: Math with dates? A Webhook Solution! - Chapman Bright","og_description":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo.","og_url":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/","og_site_name":"Chapman Bright","article_modified_time":"2025-11-17T11:42:24+00:00","twitter_card":"summary_large_image","twitter_site":"@chapmanbright","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/","url":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/","name":"Marketo: Math with dates? A Webhook Solution! - Chapman Bright","isPartOf":{"@id":"https:\/\/chapmanbright.com\/nl\/#website"},"datePublished":"2014-08-14T11:21:30+00:00","dateModified":"2025-11-17T11:42:24+00:00","description":"Challenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it's not possible in Marketo.","breadcrumb":{"@id":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/chapmanbright.com\/nl\/resources\/other\/marketo-math-with-dates-a-webhook-solution\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/chapmanbright.com\/nl\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/chapmanbright.com\/nl\/resources\/%resource%\/"},{"@type":"ListItem","position":3,"name":"Marketo: Math with dates? A Webhook Solution!"}]},{"@type":"WebSite","@id":"https:\/\/chapmanbright.com\/nl\/#website","url":"https:\/\/chapmanbright.com\/nl\/","name":"Chapman Bright","description":"","publisher":{"@id":"https:\/\/chapmanbright.com\/nl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/chapmanbright.com\/nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/chapmanbright.com\/nl\/#organization","name":"Chapman Bright","url":"https:\/\/chapmanbright.com\/nl\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/chapmanbright.com\/nl\/#\/schema\/logo\/image\/","url":"https:\/\/chapmanbright.com\/wp-content\/uploads\/2019\/03\/logo_chapmanbright_colour_RGB.png","contentUrl":"https:\/\/chapmanbright.com\/wp-content\/uploads\/2019\/03\/logo_chapmanbright_colour_RGB.png","width":2000,"height":338,"caption":"Chapman Bright"},"image":{"@id":"https:\/\/chapmanbright.com\/nl\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/chapmanbright","https:\/\/www.linkedin.com\/company\/chapman-bright\/"]}]}},"_links":{"self":[{"href":"https:\/\/chapmanbright.com\/nl\/wp-json\/wp\/v2\/resources\/1483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chapmanbright.com\/nl\/wp-json\/wp\/v2\/resources"}],"about":[{"href":"https:\/\/chapmanbright.com\/nl\/wp-json\/wp\/v2\/types\/resources"}],"wp:attachment":[{"href":"https:\/\/chapmanbright.com\/nl\/wp-json\/wp\/v2\/media?parent=1483"}],"wp:term":[{"taxonomy":"cb_resources_category","embeddable":true,"href":"https:\/\/chapmanbright.com\/nl\/wp-json\/wp\/v2\/cb_resources_category?post=1483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}