{"id":815,"date":"2022-01-14T13:58:06","date_gmt":"2022-01-14T13:58:06","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=815"},"modified":"2022-06-10T10:03:27","modified_gmt":"2022-06-10T10:03:27","slug":"get-date-from-string","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/get-date-from-string\/","title":{"rendered":"Get Date From String"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Converts string to date.&nbsp; Useful when date or datetime comes from an external resource (e.g. API or from the webhook) and it is needed to set the date in a Sugar date\/datetime field according to Sugar date\/datetime format.<\/p>\n\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#9ed267;\">string<\/span> &#8211; link with a string that represents the date<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#9ed267;\">format<\/span> &#8211; specify the format of the date in string. The full list of allowed date formats you can find&nbsp;<a href=\"https:\/\/www.php.net\/manual\/en\/datetime.createfromformat.php\" rel=\"noreferrer noopener\" target=\"_blank\">here<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p>Most common formats:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>When the date looks like this&#8230;.<\/td><td>&#8230;use this format<\/td><\/tr><tr><td>2021-11-27 23:04:13<\/td><td>Y-m-d H:i:s<\/td><\/tr><tr><td>27\/11\/2021 17:45:12<\/td><td>d\/m\/Y H:i:s<\/td><\/tr><tr><td>27\/11\/21<\/td><td>d\/m\/y<\/td><\/tr><tr><td>5:45pm on Thursday 25th November 2021<\/td><td>g:ia \\o\\n l jS F Y<\/td><\/tr><tr><td>1637849455<\/td><td>u<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><span style=\"color:#deb7ca;\">is in user&#8217;s timezone<\/span> &#8211; set to &#8216;Yes&#8217; if resulting date must be converted to the current Sugar user\u2019s time zone settings.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><strong>outputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#64c6ca;\">date<\/span> &#8211; date created from the string using the specified format in user&#8217;s timezone or as is.&nbsp;<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-65-beaf66db095241fdbc7bad0fdb7e198a.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-65-beaf66db095241fdbc7bad0fdb7e198a-1024x491.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p><div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_815' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-815\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-1337faf9e1e60' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-1337faf9e1e60'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='815' \n                                      data-rating='0'\n                                      data-rater-starsize='24'\n                                      data-rater-readonly='false'\n                                      data-rater-nonce='fa81b01ba5' \n                                      data-issingular='false'\n                                    ><\/div><div class=\"yasr-vv-stats-text-container\" id=\"yasr-vv-stats-text-container-1337faf9e1e60\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"815\" \n                               id=\"yasr-stats-dashicon-1337faf9e1e60\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-1337faf9e1e60\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-1337faf9e1e60\">0<\/span>  Average: <span id=\"yasr-vv-average-container-1337faf9e1e60\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-1337faf9e1e60' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-1337faf9e1e60' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Converts string to date.&nbsp; Useful when date or datetime comes from an external resource (e.g. API or from the webhook) and it is needed to set the date in a Sugar date\/datetime field according to Sugar date\/datetime format. inputs: string &#8211; link with a string that represents the date Required: yes format &#8211; specify the &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-date-from-string\/\"> <span class=\"screen-reader-text\">Get Date From String<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"tags":[],"class_list":["post-815","page","type-page","status-publish","hentry"],"yasr_visitor_votes":{"number_of_votes":0,"sum_votes":0,"stars_attributes":{"read_only":false,"span_bottom":false}},"_links":{"self":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/comments?post=815"}],"version-history":[{"count":4,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/815\/revisions"}],"predecessor-version":[{"id":1722,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/815\/revisions\/1722"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=815"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}