使用 Mule 4 中的开始日期和天数计算结束日期
calculate end date using start date and number of days in Mule 4
我需要在 Mule 4 中使用开始日期和天数来计算结束日期。
我有开始日期和 dayCount,我需要从中计算 sql 查询的结束日期,我在 Mule 4 中向其传递开始日期和结束日期。
https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-add-and-subtract-time
%dw 2.0
output application/json
var numberOfDays = 3
---
{
yesterday: now() - |P1D|,
theOtherDay: now() - ("P$(numberOfDays)D" as Period),
a: |2003-10-01| - |P1Y|,
b: |P1Y| - |2003-10-01|,
c: |2003-10-01T23:57:59Z| - |P1Y|,
d: |2003-10-01T23:57:59Z| + |P1Y|,
e: |2003-10-01T23:57:59| - |P1Y|,
f: |PT9M| - |23:59:56|,
g: |23:59:56| + |PT9M|,
h: |23:59:56-03:00| - |PT9M|,
u: |23:59:56-03:00| - |22:59:56-03:00|,
j: |23:59:56-03:00| - |22:59:56-00:00|,
k: |2003-10-01T23:57:59| - |P2Y9M1D| - |PT57M59S| + |PT2H|,
l: |23:59:56| - |22:59:56|,
o: |2003-10-01| - |2002-09-23|,
p: |2003-10-01T23:57:59Z| - |2002-10-01T23:57:59Z|,
q: |2003-10-01T23:57:59| - |2002-10-01T23:57:59|
}
我需要在 Mule 4 中使用开始日期和天数来计算结束日期。 我有开始日期和 dayCount,我需要从中计算 sql 查询的结束日期,我在 Mule 4 中向其传递开始日期和结束日期。
https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-add-and-subtract-time
%dw 2.0
output application/json
var numberOfDays = 3
---
{
yesterday: now() - |P1D|,
theOtherDay: now() - ("P$(numberOfDays)D" as Period),
a: |2003-10-01| - |P1Y|,
b: |P1Y| - |2003-10-01|,
c: |2003-10-01T23:57:59Z| - |P1Y|,
d: |2003-10-01T23:57:59Z| + |P1Y|,
e: |2003-10-01T23:57:59| - |P1Y|,
f: |PT9M| - |23:59:56|,
g: |23:59:56| + |PT9M|,
h: |23:59:56-03:00| - |PT9M|,
u: |23:59:56-03:00| - |22:59:56-03:00|,
j: |23:59:56-03:00| - |22:59:56-00:00|,
k: |2003-10-01T23:57:59| - |P2Y9M1D| - |PT57M59S| + |PT2H|,
l: |23:59:56| - |22:59:56|,
o: |2003-10-01| - |2002-09-23|,
p: |2003-10-01T23:57:59Z| - |2002-10-01T23:57:59Z|,
q: |2003-10-01T23:57:59| - |2002-10-01T23:57:59|
}