[英]Convert String to date using Datawave Mule
I want to convert a string "2016-04-09" to a date using datawave mule , any idea guys ? 我想使用datawave ule子将字符串“ 2016-04-09”转换为日期,好主意吗?
When i use : 当我使用时:
%dw 1.0
%output application/json
---
{
d1: "2016-04-09" as :date
}
i got SUN Mar 09 00:00:00 CET 2016
as result but i want '2016-04-09'
date type instead 我得到
SUN Mar 09 00:00:00 CET 2016
作为结果,但我想使用'2016-04-09'
日期类型
尝试使用以下表达式,
foo: "2016-04-09" as :date {class : "java.util.Calendar", format : "yyyy-MM-dd"}
here we go: 开始了:
%dw 1.0
%output application/json
---
{
foo: "2016-04-09" as :date
}
also take a look at the documentation . 也看一下文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.