<?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>topic WFA - MVEL Function to get current date in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101612#M17994</link>
    <description>&lt;P&gt;Has anybody been able to create an MVEL function to get the current date? Or is this even possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping to use this so that when I called the function it would return a date in a format i.e. ddMMMyyyy. I've been reading up and have been trying different things, but have had no luck what so ever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Clayton&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2015 14:47:21 GMT</pubDate>
    <dc:creator>CLAYTONJS</dc:creator>
    <dc:date>2015-03-10T14:47:21Z</dc:date>
    <item>
      <title>WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101612#M17994</link>
      <description>&lt;P&gt;Has anybody been able to create an MVEL function to get the current date? Or is this even possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping to use this so that when I called the function it would return a date in a format i.e. ddMMMyyyy. I've been reading up and have been trying different things, but have had no luck what so ever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Clayton&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 14:47:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101612#M17994</guid>
      <dc:creator>CLAYTONJS</dc:creator>
      <dc:date>2015-03-10T14:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101616#M17997</link>
      <description>&lt;P&gt;Hi Clayton,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try a new function with this MVEL code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def Timestamp(hello) {&lt;/P&gt;&lt;P&gt;import java.util.Date;&lt;/P&gt;&lt;P&gt;d=new Date();&lt;/P&gt;&lt;P&gt;&amp;nbsp;return d;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During the test call it with Timestamp(1) , so it is not empty in the inputs, the number 1 is not used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 15:02:56 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101616#M17997</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2015-03-10T15:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101625#M18002</link>
      <description>&lt;P&gt;Good solution terentino. As an alternative which completely gives date in format ddMMyyyy is the below function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;def GetDate(hello) {&lt;BR /&gt;import java.util.*;&lt;BR /&gt;import java.text.SimpleDateFormat;&lt;/P&gt;&lt;P&gt;return new SimpleDateFormat("ddMMyyyy").format(Calendar.getInstance().getTime());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call it the same way like GetDate(1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 16:17:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101625#M18002</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-03-10T16:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101626#M18003</link>
      <description>&lt;P&gt;Hi Clayton,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I got this from one of the community contributors,&amp;nbsp;&lt;SPAN&gt;bestinj.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def getDate(data)&lt;BR /&gt;{&lt;BR /&gt;java.util.Calendar cal= java.util.Calendar.getInstance(java.util.Locale.getDefault()) ;&lt;BR /&gt;java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("HH-mm-MM-dd-yy");&lt;BR /&gt;return format.format(cal.getTime());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Call the function as&amp;nbsp;getDate(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to bestinj for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can play with the&amp;nbsp;&lt;SPAN&gt;SimpleDateFormat("HH-mm-MM-dd-yy") for different date formats.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;adai&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 16:24:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101626#M18003</guid>
      <dc:creator>Adai</dc:creator>
      <dc:date>2015-03-10T16:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101629#M18005</link>
      <description>&lt;P&gt;That is perfect guys. Thank you very much. You have&amp;nbsp;made my life much easier and my WFA workflows a lot cleaner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Clayton&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 17:15:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/101629#M18005</guid>
      <dc:creator>CLAYTONJS</dc:creator>
      <dc:date>2015-03-10T17:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - MVEL Function to get current date</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/109607#M19323</link>
      <description>&lt;P&gt;Above solutiuons caused a&amp;nbsp;syntax error on my system, so I created this one :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;def getDate(dateFormat) {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// dateFormat - string for SimpleDateFormat&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;import java.text.SimpleDateFormat;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;import java.util.Date;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Date curDate = new Date();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SimpleDateFormat format = new SimpleDateFormat(dateFormat);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;String DateToStr = format.format(curDate);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;return (DateToStr);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;You call it&amp;nbsp;: &lt;FONT face="courier new,courier"&gt;getDate('yyyy_MM_dd')&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:06:24 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-MVEL-Function-to-get-current-date/m-p/109607#M19323</guid>
      <dc:creator>Siegfried</dc:creator>
      <dc:date>2015-09-09T16:06:24Z</dc:date>
    </item>
  </channel>
</rss>

