{"id":802,"date":"2022-01-14T13:04:38","date_gmt":"2022-01-14T13:04:38","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=802"},"modified":"2022-08-02T18:57:52","modified_gmt":"2022-08-02T18:57:52","slug":"get-date-from-datetime","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/get-date-from-datetime\/","title":{"rendered":"Get Date From Datetime"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Converts Datetime to Date.<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>Please note that when Datetime comes directly from the Sugar database (e.g. after getting value using <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a>), it is converted to UTC, not the user TimeZone.<\/p>\n<p>Let\u2019s say that the User with TimeZone GMT+3 sees the date and time as 2020-08-03 02:00. In database date is 2020-08-02 23:00, which means after converting such Datetime to Date, the date in the result is 2020-08-02<\/p>\n<\/div>\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#64c6ca;\">datetime<\/span> &#8211; input datetime value (e.g. from Sugar DateTime field)<\/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; extracted date from the input datetime<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"241\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-61-42c8fa8518e048bfbedcc6cbfea83d44.png\" alt=\"\" class=\"wp-image-510\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-61-42c8fa8518e048bfbedcc6cbfea83d44.png 961w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-61-42c8fa8518e048bfbedcc6cbfea83d44-300x75.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2021\/12\/img-61-42c8fa8518e048bfbedcc6cbfea83d44-768x193.png 768w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/figure>\n\n\n\n<p><\/p>\n<div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_802' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-802\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-9019fe0d36a89' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-9019fe0d36a89'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='802' \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-9019fe0d36a89\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"802\" \n                               id=\"yasr-stats-dashicon-9019fe0d36a89\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-9019fe0d36a89\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-9019fe0d36a89\">0<\/span>  Average: <span id=\"yasr-vv-average-container-9019fe0d36a89\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-9019fe0d36a89' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-9019fe0d36a89' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Converts Datetime to Date. Please note that when Datetime comes directly from the Sugar database (e.g. after getting value using Get Entity Attributes), it is converted to UTC, not the user TimeZone. Let\u2019s say that the User with TimeZone GMT+3 sees the date and time as 2020-08-03 02:00. In database date is 2020-08-02 23:00, which &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-date-from-datetime\/\"> <span class=\"screen-reader-text\">Get Date From Datetime<\/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-802","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\/802","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=802"}],"version-history":[{"count":3,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/802\/revisions"}],"predecessor-version":[{"id":2043,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/802\/revisions\/2043"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=802"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}