<?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>convert a Unix timestamp to DateTime</title><link>https://community.appian.com/discussions/f/general/24494/convert-a-unix-timestamp-to-datetime</link><description>How can I convert a Unix timestamp to DateTime?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94605?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 16:18:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9d696ef-2475-410f-a5a4-165458c84e33</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="26843" url="~/discussions/f/general/24494/convert-a-unix-timestamp-to-datetime/94597#94597"](don&amp;#39;t watch if you can avoid)[/quote]
&lt;p&gt;lol, it&amp;#39;s a good show though!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94603?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 15:39:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24120832-07cf-4f10-b3df-9367beed3e44</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>&lt;p&gt;I was also looking for that function tbh although I haven&amp;#39;t used it before.&lt;/p&gt;
&lt;p&gt;And I was wondering how is possible that there isn&amp;#39;t available a basic function like this so far.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the conversion, the ePoch timestamp to Appian dateTime conversion is not so accurate. If you check the minutes on the hour are not the same as the current hour.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The conversion to date is fine but if you need the response date to be precise, then you need a different formula.&lt;/p&gt;
&lt;p&gt;PS. this is a nice to have function from Appian.&lt;/p&gt;
&lt;p&gt;Edit. there is a function:&amp;nbsp;&amp;nbsp;&lt;span&gt;fromUnixTimestamp()&amp;nbsp; but the result is the same as the solution we gave so far.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="49" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1651679065121v1.png" width="402" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="149" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1651678601125v4.png" width="289" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94600?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 15:20:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4100223e-0afb-4fe8-9170-8760dcbf1645</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Good point, I didn&amp;#39;t check that far.&amp;nbsp; That&amp;#39;s probably why I didn&amp;#39;t recognize it (my dev environment is one i inherited with a bunch of plug-ins already installed which I didn&amp;#39;t vet myself).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94599?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 15:10:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:85a2b663-a518-42cd-8a4b-348f1bdd970c</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Use the following plugin:&lt;br /&gt;&lt;a href="/b/appmarket/posts/date-and-time-utilities"&gt;https://community.appian.com/b/appmarket/posts/date-and-time-utilities&lt;/a&gt;&lt;br /&gt;It has two new functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li class="ql-indent-1"&gt;toUnixTimestamp - Returns the Unix timestamp from datetime&lt;/li&gt;
&lt;li class="ql-indent-2"&gt;fromUnixTimestamp - Returns a Date and Time value by converting a Unix timestamp.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94598?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 15:08:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:107176bc-1d99-40f3-9282-1434112f7646</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;sure &amp;quot;&lt;strong&gt;&lt;em&gt;addSeconds()&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;&lt;span&gt;&amp;nbsp;&amp;quot; is an official appian function and no plugin function?&lt;br /&gt;Edit: aaah found it:&amp;nbsp;&lt;a href="/b/appmarket/posts/date-and-time-utilities"&gt;https://community.appian.com/b/appmarket/posts/date-and-time-utilities&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94597?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 14:37:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a12b2489-1ab6-485b-bb04-f657cd9c6526</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;Lets see if we can work out the math ourselves.&lt;/p&gt;
&lt;p&gt;So unix timestamp is seconds since 1970.&amp;nbsp; Appian timestamp is DAYS since 2035 (so it&amp;#39;s actually a negative number that keeps diminishing for now).&lt;/p&gt;
&lt;p&gt;Perhaps what you do is convert seconds to days, so Unix timestamp&amp;nbsp;/ ( 3600 times 24).&amp;nbsp; That gives you days since 1970 and Appian has days since 2035.&amp;nbsp; Simple addition or subtraction should get you from there.&lt;/p&gt;
&lt;p&gt;You can do lots of things to calculate it.&amp;nbsp; One time, I said, &amp;quot;Duh, 525600 minutes!&amp;quot;, and my friend sitting next to me said, &amp;quot;Did you just use the RENT method?&amp;quot;&amp;nbsp; I did.&amp;nbsp; I remembered that song from RENT (don&amp;#39;t watch if you can avoid).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94595?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 14:36:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad53a1e8-e1eb-491a-bde2-7f228f63e3b1</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I was going to suggest the &lt;em&gt;intervalds()&lt;/em&gt; function, but upon testing it appears to not like large values for &lt;em&gt;seconds&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;That said, the &lt;em&gt;seconds()&lt;/em&gt; function appears to work here, too, if it helps anyone simplify things slightly.&lt;/p&gt;
&lt;pre&gt;datetime(1970, 1, 1, 00, 00) + second() * 1651670870&lt;br /&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1651674998755v1.png" /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Edit to add: I never realized there&amp;#39;s an &lt;strong&gt;&lt;em&gt;addSeconds()&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt; function too.&amp;nbsp; Maybe it&amp;#39;s newer?&amp;nbsp; (edit: it&amp;#39;s from a plug-in, thanks Richard)&lt;/p&gt;
&lt;pre&gt;addseconds(datetime(1970, 1, 1, 00, 00), 1651670870)&lt;/pre&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1651676502547v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94593?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 14:24:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc42057f-8825-41a9-9488-0cfd89b6ccc5</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Hello Ernesto,&lt;br /&gt;sounds stupid but you caculate it&lt;br /&gt;Unix time is basically a time difference.&amp;nbsp;&lt;br /&gt;&amp;nbsp;This count starts at the Unix Epoch on January 1st, 1970 at UTC&lt;/p&gt;
&lt;p&gt;We are around at unix timestamp of&amp;nbsp;1651674100 currently&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;So&amp;nbsp;&lt;span&gt;1651674100/3600 = is the amount of hours&lt;br /&gt;&lt;/span&gt;A Years is &lt;span&gt;1651674100/&lt;/span&gt;&amp;nbsp;31556926 is the amount of years&lt;br /&gt;&lt;a href="https://www.unixtimestamp.com/"&gt;https://www.unixtimestamp.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;perhaps somebody has a suitable formula available. but basically you calculate what your number means as time difference&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: convert a Unix timestamp to DateTime</title><link>https://community.appian.com/thread/94592?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 14:20:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:901d3e11-4a3f-4b04-af27-6d8ab3f3d147</guid><dc:creator>Dimitris Soulovaris</dc:creator><description>&lt;p&gt;Since a Unix timestamp is the number of seconds from 01/01/1970 till now, you can try something like this:&lt;/p&gt;
&lt;p&gt;(1651670870 / 86400) + datetime(1970, 01, 01, 00, 00)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1651674057203v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>