<?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 string to timestamp(6)</title><link>https://community.appian.com/discussions/f/user-interface/34806/convert-string-to-timestamp-6</link><description>Hello everyone, 
 I have a field for created date of type varchar(255) and it has the value in string, for example: &amp;quot;20220505101000345600&amp;quot;, what I did before was converting it to date before saving it to database with this expression: 
 concat( mid( index</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134377?ContentTypeID=1</link><pubDate>Sat, 27 Apr 2024 06:40:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a926846-f80f-4c9f-aa20-118861c0aea8</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Keep in mind, that this method might or might not display the date value in the wrong timezone. The reason is, that the string in the DB probably is stored in UTC. Then you would want, or maybe not, convert the value into the users timezone.&lt;/p&gt;
&lt;p&gt;The datetime() function does not perform this conversion. If you need that, use userdatetime().&lt;/p&gt;
&lt;p&gt;And for more background on this, read my blog post:&amp;nbsp;&lt;a href="https://appian.rocks/2023/02/13/working-with-time-in-appian/"&gt;https://appian.rocks/2023/02/13/working-with-time-in-appian/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134375?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 19:47:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:187183aa-1135-40dc-a713-830529659a2b</guid><dc:creator>blerinadurguti</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s what I did as well but instead of tostring I used the datetext function. Thanks&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!pulsarMessageValue: &amp;quot;20220505101000345600&amp;quot;,
  local!dateTime: datetime(
    left(local!pulsarMessageValue, 4),
    mid(local!pulsarMessageValue, 5, 2),
    mid(local!pulsarMessageValue, 7, 2),
    mid(local!pulsarMessageValue, 9, 2),
    mid(local!pulsarMessageValue, 11, 2),
    left(mid(local!pulsarMessageValue, 13, 8), 2)
  ),
  datetext(
    local!dateTime,
    &amp;quot;HH:mm:ss, dd.MM.yyyy&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134373?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 17:32:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2b3a6fd8-11de-429e-ba52-7ef3252edf08</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Are you aware that the tostring() function does not provide any means of formatting and no second parameter? You should try the text() function instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134372?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 17:16:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f166601-2741-4191-be62-571ca85ba9f9</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a href="/members/blerinad9411"&gt;blerinadurguti&lt;/a&gt;&amp;nbsp;,&lt;br /&gt;&lt;br /&gt;Based on your input i tried converting text to dateTime verify and make changes according to your need.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!pulsarMessageValue: &amp;quot;20220505101000345600&amp;quot;,
  local!dateTime: datetime(
    int(left(local!pulsarMessageValue, 4)),
    int(mid(local!pulsarMessageValue, 5, 2)),
    int(mid(local!pulsarMessageValue, 7, 2)),
    int(mid(local!pulsarMessageValue, 9, 2)),
    int(mid(local!pulsarMessageValue, 11, 2)),
    int(
      left(mid(local!pulsarMessageValue, 13, 8), 2)
    )
  ),
  text(
    local!dateTime,
    &amp;quot;yyyy-MM-dd HH:mm:ss&amp;quot;
  )
)&lt;/pre&gt;&lt;br /&gt;Let me know if that works for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134345?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 12:07:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa802784-4052-4608-abc5-6db1e3e8f204</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;If you only need it in the interface, and don&amp;#39;t need it for calculations..... use string...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134341?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 11:53:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a5680323-0956-40ae-ba39-a0062d6611ec</guid><dc:creator>blerinadurguti</dc:creator><description>&lt;p&gt;I got a feedback that is better to store it as timestamp rather than string and then do the calc in the interface part, that&amp;#39;s why&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert string to timestamp(6)</title><link>https://community.appian.com/thread/134340?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 11:52:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cbccad3-a512-4dcb-bb4a-c79aa0c10868</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Why don&amp;#39;t you use it as a string instead of converting to date??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>