如何在mule4中格式化2位数字的月/日?

问题描述 投票:0回答:1

我正在尝试以s3格式创建月/日期格式的文件名。我不想将May打印为5。它必须是'05'我尝试过

  now().month as Number {format: "00"}

now().month as Number {format: "##"}

均打印5。不是05

<set-variable value="#[now().year ++ '/' ++ now().month as Number {format: &quot;00&quot;}++ '/'++ now().day as Number {format: &quot;##&quot;} ++'/'++ now() as String {format: &quot;yyyyMMdd_HHmmss&quot;} ++&quot;.json&quot;]"  doc:name="S3-filename" doc:id="ff101e31-4f6c-45f5-9669-a60fbc32204e" variableName="s3filename"/>
mule mule-studio mulesoft mule-esb
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.