English 中文(简体)
• 如何将时间推到DW的几分钟?
原标题:How to truncate DateTime to minutes in DW?

寻找一种方式,以缩短时间价值(例如现在的()结果)至分钟,同时保留时间区,即:

来源:<2023-10-04T10:48:07.975905Z 页: 1

To: 48:00.000000Z 页: 1

当然,这可以通过先把时间改为强硬,然后适用扼制操纵,然后改写到日期。 但很奇怪,我猜测。

因此,寻找实现这一结果的更明智的方法。

Mule provides the similar function atBeginningOfHour that s doing truncation on an hour level.
I m looking for a similar function but for minutes.

Mule DW版本为2.4.0(最新版本)。

问题回答

采用时间分辨率和秒数的解决办法。 我用扼杀干涉手段将二头和纳米秒结合起来。 可以用数学表述取而代之,但我认为,意图可能并不明确。

import * from dw::core::Periods

fun truncateAtMinutes(t)=t - minutes(t.minutes) - seconds("$(t.seconds).$(t.nanoseconds)") 
---
truncateAtMinutes(|2023-10-04T10:48:07.975905-03:00|)

产出:

|2023-10-04T10:00:00-03:00|




相关问题
Mule ESB - How to get MimeMessage instead of MimeBodyPart?

I m trying to get the FROM email address in Mule ESB. I m getting the retrieved object as MimeBodyPart, I d like to have MimeMessage instead. How to do this? Any solution - either in Mule or Java is ...

JaxWsProxyFactoryBean for Mule CXF transport?

I am new to mule. Are there any way to call CXF based web services using JaxWsProxyFactoryBean? It will be nice to reuse Java interface instead of wsdl files. With CXF we can simply reuse our java ...

Drools, spring and mule

Has anyone combined these technologies? Could you share lessons learnt?

How to keep inbound host with custom Mule ESB router

I created a custom router with one endpoint. The custom router looks up the destination of the endpoint based on the URL parameters of the inbound URL. I have an example of this up and running, and I ...

热门标签