You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by prabhu Mahendran <pr...@gmail.com> on 2017/05/26 12:35:40 UTC

How to find week of the year for the date value?

My Flow having attribute '05-05-2015'.And i need to find week of the date
in NiFi.

For example:

if date is 05 then it is belongs to 1st week of the year.

I shouldn't use Script/Program for find out week.

i need to find out that using NiFi Expression language only.

Can anyone suggest way to do that?

Re: How to find week of the year for the date value?

Posted by Mark Payne <ma...@hotmail.com>.
Prabhu,

You can use the "toDate" function to convert that string into a Date and then use
the "format" function to convert that date into what you want using the patterns defined
for SimpleDateFormat. You can see what those patterns/symbols mean and examples
at [1]. I hope this helps.

Thanks
-Mark

[1] https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html



On May 26, 2017, at 8:35 AM, prabhu Mahendran <pr...@gmail.com>> wrote:


My Flow having attribute '05-05-2015'.And i need to find week of the date in NiFi.

For example:

if date is 05 then it is belongs to 1st week of the year.


I shouldn't use Script/Program for find out week.

i need to find out that using NiFi Expression language only.

Can anyone suggest way to do that?