<?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>Date time of a timezone</title><link>https://community.appian.com/discussions/f/general/10290/date-time-of-a-timezone</link><description>We are saving our date as 
 
 now() 
 
 and displaying in a grid as shown below 
 
 a!gridTextColumn(label: &amp;quot;Added On&amp;quot;, field: &amp;quot;createdDtm&amp;quot;, data:datetext(index(local!docDataSubset.data,&amp;quot;createdDtm&amp;quot;,{}),&amp;quot;MM/dd/yyyy hh:mm:ss&amp;quot;)), 
 
 
 The user time zone</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45471?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 14:22:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3d63122d-a729-4f3b-9768-dd4fce0d7210</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>Thanks . How to add 4 hours to the current date time &lt;br /&gt;
&lt;br /&gt;
If i display like this &lt;br /&gt;
&lt;br /&gt;
a!gridTextColumn(label: &amp;quot;Added On&amp;quot;, field: &amp;quot;createdDtm&amp;quot;, data:datetext(index(local!docDataSubset.data,&amp;quot;createdDtm&amp;quot;,{}),&amp;quot;MM/dd/yyyy hh:mm:ss&amp;quot;)),&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45447?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 07:07:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45e45628-f1fe-4fef-9dc0-572566b9cba2</guid><dc:creator>harshav</dc:creator><description>When I had the similar issue I used to show the datetime column with the GMT so that when ever the time is mentioned , it used to show like 530 GMT+xx hours based on which we can understand the EDT timings, if you are not showing the GMT text then as the other practitioners said you have to use gmt() function to show that in the specific timezone apart from default time.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45445?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 05:13:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e60b2e4-a7ae-44be-91dd-6f196388523d</guid><dc:creator>Stefan Helzle</dc:creator><description>I suggest to rely in the method Appian uses by default. This is, time and date is GMT internally and in database. Towards the user it is converted to his/her timezone automatically. This works most of the time. In some rare cases you need to do the conversion to user timezone manually. If you do any conversion before writing to DB you confuse this mechanism.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45442?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 17:59:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:367b0888-01af-4c8e-8f69-7575c84bf96d</guid><dc:creator>abhinavg712</dc:creator><description>&lt;a href="/members/ramanan"&gt;ramanan&lt;/a&gt; ,  Appian stores Date and Time variables to the database as GMT by default, to store them as EST/EDT in the database, we must convert back and forth.&lt;br /&gt;
See forum post: &lt;a href="https://forum.appian.com/suite/tempo/news/entry/e-118813"&gt;forum.appian.com/.../e-118813&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Try to use to rules while storing and reading the date values.&lt;br /&gt;
&lt;br /&gt;
1. rule!convertDateTimeforDBWrite --   &lt;br /&gt;
&lt;br /&gt;
local(&lt;br /&gt;
    ri!dateValue,&lt;br /&gt;
    cons!ENV_DATABASE_TIMEZONE&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
2. rule!convertDateTimeforDBRead --   &lt;br /&gt;
  gmt(&lt;br /&gt;
    ri!dateValue,&lt;br /&gt;
    cons!ENV_DATABASE_TIMEZONE&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
here, cons!ENV_DATABASE_TIMEZONE == America/New_York&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45439?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 15:16:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9dabde63-40bc-41f4-974a-da88dbca78a0</guid><dc:creator>lucasj</dc:creator><description>&lt;p&gt;Hi Ramanan,&lt;/p&gt;
&lt;p&gt;I can suggest a couple of different approaches to hard code the expression here, although I wouldn&amp;#39;t consider these a best practice since they will only work for users in the Eastern time zone (which, as I understand, is your entire user group for this scenario):&lt;/p&gt;
&lt;p&gt;1) You could use the caladdhours() method documented at &lt;a href="https://docs.appian.com/suite/help/17.1/fnc_date_and_time_caladdhours.html"&gt;https://docs.appian.com/suite/help/17.1/fnc_date_and_time_caladdhours.html&lt;/a&gt;. &amp;nbsp;You&amp;#39;ll need to make sure you&amp;#39;ve set your working hours to the entire day all 7 days of the week in the system calendar settings if using this approach.&lt;/p&gt;
&lt;p&gt;2) You could alter the datetime in SAIL with an expression similar to the following:&lt;/p&gt;
&lt;p&gt;if(&lt;br /&gt; hour(now()) &amp;lt;= 19,&lt;br /&gt; datetime(year(now()), month(now()), day(now()), (hour(now())+4), minute(now()), second(now())),&lt;br /&gt; datetime(year(now()), month(now()), (day(now())+1), (4-(24-hour(now()))), minute(now()), second(now()))&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Again, these solutions will only work for users in the one time zone you specified, so I&amp;#39;d highly recommend looking into solutions around the system timezone if that is an option.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Lucas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45438?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 14:41:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:20941521-fbdf-4ff2-9e4d-41ebe97c7e21</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>Thanks for the response . &lt;br /&gt;
&lt;br /&gt;
Say I am analyst ,I browse from newyork ,  i have EDT in my user settings , i save the comment on 9:30 EDT , it is saved as a!save() now() . when this comment is displayed in the grid , the time shown is 5:30 EDT ( It is saved to DB as 5:30 EDT 4 hours less than my current time)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45437?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 14:37:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b75ba262-6b34-4d4a-8ccc-9cff9b2b384e</guid><dc:creator>Shreehari Gopalakrishnan Ramanan</dc:creator><description>Thanks Alok for response . Yes i am talking about the client system date and time&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45435?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 14:13:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:980cac03-b177-4517-ab9b-8fe0516d928c</guid><dc:creator>lucasj</dc:creator><description>&lt;p&gt;As mentioned by Alok, the now() function will return the current system time. &amp;nbsp;If you set your system time to GMT, you can use the following function to convert to other timezones:&lt;/p&gt;
&lt;p&gt;gmt(now(), &amp;quot;America/New_York&amp;quot;)&lt;/p&gt;
&lt;p&gt;A description of this function is available at &lt;a href="https://docs.appian.com/suite/help/17.1/fnc_date_and_time_gmt.html"&gt;https://docs.appian.com/suite/help/17.1/fnc_date_and_time_gmt.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time of a timezone</title><link>https://community.appian.com/thread/45422?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 05:30:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b6b26db2-2ca4-4843-8ed3-288775f91998</guid><dc:creator>aloks0189</dc:creator><description>&lt;a href="/members/ramanan"&gt;ramanan&lt;/a&gt; As per my understanding, these functions displays the Server time as well as Date. Because of this Usually we find some differences between returned response by these functions and the Client System Date and Time, are you talking about Client machine Date and Time?&lt;br /&gt;
&lt;br /&gt;
For better understanding you can set an additional clock for EDT timezone then try doing the same to identify&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>