如何找到日期值的一年中的星期几?

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

我的流程具有属性“05-05-2015”。我需要在 NiFi 中找到日期的星期。

For example:

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

我不应该使用 Script/Program 寻找周。

我需要找出仅使用 NiFi 表达式语言。

任何人都可以建议这样做的方法吗?

假设 eee 是您的属性

然后表达式

${eee:toDate('MM-dd-yyyy'):format('u E')}

输出: 2 Tue

格式参考:

http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html