{"id":3544,"date":"2020-01-13T19:48:06","date_gmt":"2020-01-13T18:48:06","guid":{"rendered":"https:\/\/help.cirrus-shield.com\/?post_type=docs&#038;p=3544"},"modified":"2020-01-13T19:48:07","modified_gmt":"2020-01-13T18:48:07","slug":"tocurrentusertimezone","status":"publish","type":"docs","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/javascript-library\/tocurrentusertimezone\/","title":{"rendered":"toCurrentUserTimezone"},"content":{"rendered":"\n<p>This function is used to convert the\nDate\/Datetime values in any time zone to the current user time zone. It takes\nas parameters the Date\/Datetime values and the Boolean flag \u201cIsDateFormat\u201d and then\nreturns the value in current user time zone under the date format \u201cyyyy-MM-dd\u201d\nif the \u201cIsDateFormat\u201d equal to true otherwise to the date time format\n\u201cyyyy-MM-dd hh:mm:ss+TZ\u201d.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Functions<\/strong>: &nbsp;toCurrentUserTimezone(date, IsDateFormat)<\/li><li><strong>Usage<\/strong>: &nbsp;var datetimeValue\n= toCurrentUserTimezone(&#8220;2019-02-07 20:40:36+00&#8221;,\nfalse);<\/li><\/ul>\n\n\n\n<p>&nbsp;var\ndateValue\n= toCurrentUserTimezone(&#8220;2019-01-17 23:00:00+00&#8221;, true);<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Output<\/strong>:&nbsp; &#8220;2019-02-07 21:40:36+01&#8221;<\/li><\/ul>\n\n\n\n<p>&nbsp;&#8220;2019-01-18&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":945,"menu_order":27,"comment_status":"open","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_tag":[],"class_list":["post-3544","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/3544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/comments?post=3544"}],"version-history":[{"count":1,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/3544\/revisions"}],"predecessor-version":[{"id":3545,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/3544\/revisions\/3545"}],"up":[{"embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/945"}],"prev":[{"title":"Sample Code Example","link":"https:\/\/help.cirrus-shield.com\/en\/docs\/developer-guide\/javascript-library\/sample-code-example\/","href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/docs\/1039"}],"wp:attachment":[{"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/media?parent=3544"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.cirrus-shield.com\/en\/wp-json\/wp\/v2\/doc_tag?post=3544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}