encoding date and time for url paramter
import com.sap.gateway.ip.core.customdev.util.Message
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.HashMap
import java.util.TimeZone
def Message processData(Message message) {
// Get properties from the message
def map = message.getProperties()
// Define your date parameter value
String dateParam = "2024-07-18 00:00:00.000 +0200"
// Encode the date parameter value
String encodedDateParam = URLEncoder.encode(dateParam, "UTF-8")
// Since URLEncoder.encode will encode space as '+', replace '+' with '%20'
encodedDateParam = encodedDateParam.replace("+", "%20")
// Wrap the encoded string in double quotes ("%22")
encodedDateParam = "%22" + encodedDateParam + "%22"
// Add the encoded date parameter to the properties map
map.put("encodedDateParam", encodedDateParam)
// Update the message properties
message.setProperties(map)
return message
}