<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Can not convert 6 digit milliseconds in NiFi. String to toDate() conversion problem in NiFi. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303157#M221417</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/75426"&gt;@DarkStar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Your Expression Language(EL) should be&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;${field.value:substring(0,28):toDate("MMM dd,yyyy HH:mm:ss.SSSSSSSSS"):format("yyyy-MM-dd HH:mm:ss.SSSSSS")}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;In your&amp;nbsp; EL, the pattern you used has 6 "S". But, the input has precision upto 9. Since, you gave 6, it is reading the last 6 characters, i.e.,&amp;nbsp;&lt;SPAN&gt;388&lt;STRONG&gt;267000&lt;/STRONG&gt;. I think, that must be the reason.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Sep 2020 18:34:38 GMT</pubDate>
    <dc:creator>PVVK</dc:creator>
    <dc:date>2020-09-21T18:34:38Z</dc:date>
    <item>
      <title>Can not convert 6 digit milliseconds in NiFi. String to toDate() conversion problem in NiFi.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303146#M221414</link>
      <description>&lt;P&gt;Hello All and &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/55311"&gt;@Shu_ashu&lt;/a&gt;,&lt;SPAN class="UserName lia-user-name lia-user-rank-Master-Guru"&gt;&lt;A href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454" target="_self"&gt;&lt;SPAN class=""&gt;@MattWho&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have a CSV file with a time column "Apr 15, 2020 02:02:16.388267000 Paris, Madrid (heure d’été)".... "Apr 15, 2020 02:02:16.986879000 Paris, Madrid (heure d’été)"...etc.&lt;BR /&gt;Then I to convert the field time using UpdateRecord processor by the following code:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="insert_photo.JPG" style="width: 704px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/28941i3EC3D30044D1FDCE/image-size/large?v=v2&amp;amp;px=999" role="button" title="insert_photo.JPG" alt="insert_photo.JPG" /&gt;&lt;/span&gt;${field.value:substring(0,28):toDate("MMM dd,yyyy HH:mm:ss.SSSSSS"):format("yyyy-MM-dd HH:mm:ss.SSSSSS")}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But after conversion, the output I get is:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;nb&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;delta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;2020-04-15 02:08:44.000267&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;0.0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;2020-04-15 02:18:42.000879&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;0.598612&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the output should be:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;nb&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="30px"&gt;delta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Apr 15, 2020 02:02:16.388267&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;0.0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Apr 15, 2020 02:02:16.986879&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;0.598612&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I always get 000 before the milliseconds. As per the example above, I got 000&lt;STRONG&gt;267&lt;/STRONG&gt; instead of 388&lt;STRONG&gt;267&lt;/STRONG&gt; and 000&lt;STRONG&gt;879&lt;/STRONG&gt; instead of 986&lt;STRONG&gt;879&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Why I am getting the 000 instead of the real value? How can I modify me code to resolve this problem? Any help on this issue will be highly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 11:25:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303146#M221414</guid>
      <dc:creator>DarkStar</dc:creator>
      <dc:date>2026-04-21T11:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can not convert 6 digit milliseconds in NiFi. String to toDate() conversion problem in NiFi.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303157#M221417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/75426"&gt;@DarkStar&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Your Expression Language(EL) should be&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;${field.value:substring(0,28):toDate("MMM dd,yyyy HH:mm:ss.SSSSSSSSS"):format("yyyy-MM-dd HH:mm:ss.SSSSSS")}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;In your&amp;nbsp; EL, the pattern you used has 6 "S". But, the input has precision upto 9. Since, you gave 6, it is reading the last 6 characters, i.e.,&amp;nbsp;&lt;SPAN&gt;388&lt;STRONG&gt;267000&lt;/STRONG&gt;. I think, that must be the reason.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 18:34:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303157#M221417</guid>
      <dc:creator>PVVK</dc:creator>
      <dc:date>2020-09-21T18:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can not convert 6 digit milliseconds in NiFi. String to toDate() conversion problem in NiFi.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303160#M221418</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/78607"&gt;@PVVK&lt;/a&gt;,&amp;nbsp;thanks for your feedback. I trued your approach but its giving me the same result. Is NiFi (java) only support 3 digit in milliseconds? Do you have any idea? Is there any other alternative that I should try?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DarkStar_0-1600716443925.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/28942iC683AD754A7C53F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DarkStar_0-1600716443925.png" alt="DarkStar_0-1600716443925.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 19:29:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303160#M221418</guid>
      <dc:creator>DarkStar</dc:creator>
      <dc:date>2020-09-21T19:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can not convert 6 digit milliseconds in NiFi. String to toDate() conversion problem in NiFi.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303620#M221625</link>
      <description>&lt;P&gt;Used below formula to resolve my problem&lt;/P&gt;&lt;P&gt;${field.value:substring(0,21):toDate("MMM dd,yyyy HH:mm:ss"):format("yyyy-MM-dd HH:mm:ss")}.${field.value:substring(22,28)}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We separately added last 6 digit using .${field.value:substring(22,28)} after the time format.Otherwise, nifi can not process 6 digit microsecond.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:29:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-not-convert-6-digit-milliseconds-in-NiFi-String-to/m-p/303620#M221625</guid>
      <dc:creator>DarkStar</dc:creator>
      <dc:date>2020-09-29T10:29:32Z</dc:date>
    </item>
  </channel>
</rss>

