title: How to validate and convert date to valid UTC format in dataweave in mulesoft?
body: <p>We have one requirement where we need to check whether the input date is valid UTC format or not, if not we need to append zeroes to it. We are trying to implement in DW since it is the part of complex logic. but we are not able to convert and validate the date in DW. could you please help.
  %dw 1.0
  %output application/java</p>
  
  <h2>%var d= "2013-10-13T01:37:56" as :date</h2>
  
  <p>{
      endDate:"" when (d == null or d == "")  otherwise (
                             d when ( d is :date {format: 'yyyy-MMM-ddHH:mm:ss'}) otherwise (d as :date {format: "yyyy-MM-dd'T'HH:mm:ss"})
      )</p>
  
  <p>} 
  Thanks
  Sushma</p>