<?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>Covert Time to UNIX Time</title><link>https://community.appian.com/discussions/f/general/8580/covert-time-to-unix-time</link><description>I want to convert the time into UNIX Timestamp. Is it is possible in Appian to convert a time into UNIX Timestamp format? Thanks in Advance OriginalPostID-239475</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37897?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 08:51:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e3ba88fe-dc7c-4515-9bc3-17ecfcf9c27a</guid><dc:creator>Eduardo Fuentes</dc:creator><description>It would be enough by adding a new function to it as follows:&lt;br /&gt;&lt;br /&gt;@Function&lt;br /&gt;public Long getLocalTime(ServiceContext sc, @Parameter Timestamp datetime) {&lt;br /&gt;       return &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;datetime;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;because a java.sql.timestamp should already meet your requirement I believe.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37896?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 08:46:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fab8df9c-398f-413d-a22c-df4bb9aa5599</guid><dc:creator>chetany</dc:creator><description>Thanks Eduardo. I am wondering if we can modify that plugin to make it more generic. We could modify it to take a datetime as a parameter, and it should return the milliseconds since Unix  epoch to the given datetime. And if no datetime is specified, it will generate the milliseconds from epoch till now()&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37894?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 07:54:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b43f5f5-6a67-4194-acaf-3bc1282dac4e</guid><dc:creator>Eduardo Fuentes</dc:creator><description>Although that plug-in only works if what you want to convert to the timestamp is &amp;quot;now()&amp;quot;. Just thought it&amp;#39;d make sense to mention it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37892?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 07:41:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1f9fc6e1-410a-4286-a727-9a250a8c07af</guid><dc:creator>Eduardo Fuentes</dc:creator><description>Another option:  &lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUheqkLnPmguT8zKo380eyvKu30CjDWTP7mQ/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37891?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 07:13:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d566bf4-e57c-4b65-8de7-c367989d0e62</guid><dc:creator>chetany</dc:creator><description>@Eduardo, thanks for sharing. It can be useful to know how to do it the other way.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37889?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2016 04:51:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0a14b21-e60a-4876-9cc0-deb075231b10</guid><dc:creator>Eduardo Fuentes</dc:creator><description>And here&amp;#39;s a suggestion from someone to do it the other way around &lt;a href="/search?q=OriginalPostID-159035"&gt;forum.appian.com/.../f-159035&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37863?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 13:48:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:27208c3a-f0d8-452d-9eb3-efefc5033383</guid><dc:creator>sahilb</dc:creator><description>Thanks chetany. It is working properly.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37859?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 12:20:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:81dd585b-994d-4de8-b9ee-1646f6ec43a1</guid><dc:creator>chetany</dc:creator><description>Please create a rule input and use it instead of fn!now() in the above expression. It will give you the expected output for the sample input you have mentioned.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37858?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 12:14:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fa85315f-3253-49db-b1f6-97adb7c3fa8d</guid><dc:creator>chetany</dc:creator><description>Here is a Expression rule that you may use to convert time to a UNIX timestamp. It makes use of the fact that the difference between two datetimes is an interval. I have used it to convert the current datetime (now()) to UNIX timestamp&lt;br /&gt;with(&lt;br /&gt;  &lt;br /&gt;  local!unixEpoch : fn!datetime(1970, 1, 1, 0,0,0,0),&lt;br /&gt;  &lt;br /&gt;  local!intervalDiff: fn!now() - local!unixEpoch,&lt;br /&gt;  &lt;br /&gt;  local!stringintervalDiff: fn!tostring(local!intervalDiff),&lt;br /&gt;  &lt;br /&gt;  local!days: fn!tointeger(local!intervalDiff),&lt;br /&gt;  &lt;br /&gt;  local!stringPartExcludingDays: fn!split(local!stringintervalDiff, &amp;quot;::&amp;quot;)[2],&lt;br /&gt;  &lt;br /&gt;  local!splitPartExcludingDays: fn!split(local!stringPartExcludingDays, &amp;quot;:&amp;quot;),&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  local!hours: fn!tointeger(local!splitPartExcludingDays[1]),&lt;br /&gt;  &lt;br /&gt;  local!minutes: fn!tointeger(local!splitPartExcludingDays[2]),&lt;br /&gt;  &lt;br /&gt;  local!seconds: fn!tointeger(local!splitPartExcludingDays[3]),&lt;br /&gt;  &lt;br /&gt;  local!days*24*3600 + local!hours*3600 + local!minutes*60 + local!seconds&lt;br /&gt;  &lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37857?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 11:25:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:202cb3d0-b513-4b93-87c3-f07ee827c2c1</guid><dc:creator>Eduardo Fuentes</dc:creator><description>I went through the functions documentation &lt;a href="https://forum.appian.com/suite/help/16.3/Appian_Functions.html"&gt;forum.appian.com/.../Appian_Functions.html&lt;/a&gt; and didn&amp;#39;t find a way to convert to a timestamp. &lt;br /&gt;&lt;br /&gt;Maybe building a custom function that takes a date and time and returns the time stamp. Basically if you code your custom function to return a long, and you just simply return the date and time you&amp;#39;re passing, since the product maps it to java.sql.Timestamp I think you&amp;#39;ll get exactly what you need.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@Function&lt;br /&gt;public Long getLocalTime(ServiceContext sc, @Parameter Timestamp datetime) {&lt;br /&gt;&lt;br /&gt;return &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;datetime;&lt;br /&gt;}&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37856?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 11:16:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7c1f7be-26e1-4f88-8f78-5296b90cd009</guid><dc:creator>sahilb</dc:creator><description>I want to convert the Appian current timestamp into THE UTC format (Current Unix Timestamp).&lt;br /&gt;e.g: 10/08/2016 @ 6:43am (UTC) is equivalent to: &amp;quot;1475909014&amp;quot;. I want &amp;quot;1475909014&amp;quot; as an output&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Covert Time to UNIX Time</title><link>https://community.appian.com/thread/37855?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 11:01:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:23732111-bb99-4e1c-bd5e-4f8eacad26ac</guid><dc:creator>Eduardo Fuentes</dc:creator><description>Can you provide an example to make sure I suggest something that suits your requirement ? Is it really a long out of the date and time what you want to generate?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>