Skip to main content
Yashwanth K a posé une question dans #MuleSoft DataWeave

I saw some question but the solution which was given for that doesn't work. 

Payload:

{

"created_date_time": "2021-04-05 15:12:31.000"

 }

 

@Manish Yadav​  @Abhishek Bathwal​ @Tirthankar Kundu​ 

5 réponses
  1. 17 mai 2021, 09:24

    Hey,

     

    Do you have sample input for different time zone with expected time in Unix, Please provide me it will help me to understand your use case more.

    As Please refer below DataWeave As initially I have read it as LocalDateTime then convert it to DateTime

    %dw 2.0

    output application/json

    ---

    {

    "created_date_time": ((("2021-04-05 15:12:31.000" as LocalDateTime {format: "yyyy-MM-dd HH:mm:ss.SSS"}) as DateTime) as Number {unit: "milliseconds"}) / 1000

    }

    Please let me know if above solution worked or not?

    Regards,

    Shekh

0/9000