<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is the difference between gmt() and local()?</title><link>https://community.appian.com/discussions/f/general/12861/what-is-the-difference-between-gmt-and-local</link><description>I have written 
 1. gmt(now(),&amp;quot;IST&amp;quot;) 
 2. local(now(),&amp;quot;IST&amp;quot;) 
 local() function shows correct time as per local timestamp, but gmt is showing +1 hour in my current time. Anyone can explain why?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57682?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 05:23:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15369030-d849-4ff0-baf3-79d4e0001e52</guid><dc:creator>khemrajs0002</dc:creator><description>Thank you ravalik... :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57681?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 05:21:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a3dc2b3-e193-40d2-aaeb-d83c9c95b141</guid><dc:creator>khemrajs0002</dc:creator><description>Thank you so much Edwin for make me understand this in such a great way... :-)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57678?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 04:18:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5aa757c8-3efb-4f21-9a6e-5e989b0ef984</guid><dc:creator>ravalik</dc:creator><description>Hi Khemraj Soni ,&lt;br /&gt;
&lt;br /&gt;
Here gmt() and local() functions both does not store a time zone offset with the returned values.&lt;br /&gt;
gmt()    :Subtracts a time zone offset from a given Date and Time &lt;br /&gt;
Ex:  gmt(datetime(2011, 12, 13, 12, 05), &amp;quot;GST&amp;quot;) returns  12/13/2011 2:05 AM GMT+00:00 and if the time zone changes to some thing else &lt;br /&gt;
     like &lt;br /&gt;
     gmt(datetime(2011, 12, 13, 12, 05), &amp;quot;America/New_York&amp;quot;) returns  12/13/2011 5:05 PM GMT+00:00 Where as for local()&lt;br /&gt;
&lt;br /&gt;
local():   &lt;br /&gt;
 Ex:            local(datetime(2011, 12, 13, 12, 05), &amp;quot;America/New_York&amp;quot;)  returns 12/13/2011 7:05 AM GMT+00:00,&lt;br /&gt;
&lt;br /&gt;
                   local(datetime(2011, 12, 13, 12, 05), &amp;quot;GMT&amp;quot;) returns 12/13/2011 12:05 PM GMT+00:00 .&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
ravalik&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57676?ContentTypeID=1</link><pubDate>Sun, 08 Jul 2018 06:28:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f9effb8a-f781-49f5-804c-fadba67ea4da</guid><dc:creator>Edwin Yesa Thangappan</dc:creator><description>&lt;p&gt;Hi Khemraj Soni,&lt;/p&gt;
&lt;p&gt;The function gmt() is a date and time &lt;strong&gt;&lt;span style="color:#0000ff;"&gt;subtraction&lt;/span&gt;&lt;/strong&gt; function. The function local() is a date and time &lt;span style="color:#0000ff;"&gt;&lt;strong&gt;addition&lt;/strong&gt;&lt;/span&gt; function. Both functions take datetime as the first parameter and timezone as the second parameter. But the gmt() function subtracts the timezone offset from the datetime&amp;nbsp;given as the first parameter and the local() function adds the timezone offset to the first parameter.&lt;/p&gt;
&lt;p&gt;Lets say, if&amp;nbsp;the now() returns&amp;nbsp;&lt;strong&gt;7/8/2018 11:46 AM GMT+05:30&lt;/strong&gt;&amp;nbsp;and if&amp;nbsp;we pass now() to gmt() and giving the timezone as IST, gmt(now(),&amp;quot;IST&amp;quot;) will return&amp;nbsp;&lt;strong&gt;7/8/2018 6:16 &lt;em&gt;&lt;span style="color:#ff0000;"&gt;AM&lt;/span&gt;&lt;/em&gt; GMT+05:30&amp;nbsp;&lt;/strong&gt;since the timezone offset 5 hours and 30 minutes is subtracted from the given datetime.&lt;/p&gt;
&lt;p&gt;If we pass now() to gmt() and giving the timezone as IST, local(now(),&amp;quot;IST&amp;quot;) will return&amp;nbsp;&lt;strong&gt;7/8/2018 5:16 &lt;em&gt;&lt;span style="color:#ff0000;"&gt;PM&lt;/span&gt;&lt;/em&gt; GMT+05:30&lt;/strong&gt; since the timezone offset is added to the given datetime.&lt;/p&gt;
&lt;p&gt;Here notice the AM and PM&amp;nbsp;appended with the output.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57675?ContentTypeID=1</link><pubDate>Sun, 08 Jul 2018 05:28:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:86ca8a2b-9458-48a3-9da5-7a30da2f364f</guid><dc:creator>siddharthp138</dc:creator><description>&lt;p&gt;gmt function converts datetime into GMT and local function converts datatime into your profile timezone.&lt;br /&gt; &lt;br /&gt; gmt(now(),&amp;quot;IST&amp;quot;) - gmt considers 1st parameter as datetime and 2nd parameter as its timezone. So as per here gmt takes now() datetime and IST as its timezone, converts into datetime with GMT timezone&lt;br /&gt; &lt;br /&gt; local(now(),&amp;quot;IST&amp;quot;) - local considers 1st parameter as datetime and 2nd parameter as its timezone. So as per here gmt takes now() datetime and IST as its timezone, converts into datetime with your profile timezone&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here in both the cases even-though now() has its own timezone which is neglected as both gmt() &amp;amp; local() takes only datetime as first parameter&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the difference between gmt() and local()?</title><link>https://community.appian.com/thread/57672?ContentTypeID=1</link><pubDate>Sat, 07 Jul 2018 11:49:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cae520bf-0177-43b2-9199-4fabcac0123e</guid><dc:creator>surendrab0001</dc:creator><description>Reference:-&lt;a href="https://docs.appian.com/suite/help/17.1/fnc_date_and_time_gmt.html"&gt;docs.appian.com/.../fnc_date_and_time_gmt.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>