Forum Discussion

neerajan's avatar
neerajan
Occasional Contributor
8 years ago

Set the time zone to GMT of a formatted date (which is one of the request payload parameters)

I was trying to pass a formatted date value in the Media type of a request and I wanted to set the time to GMT.  When I use the below syntax in the Media Type section of the request: { "recordId...
  • groovyguy's avatar
    8 years ago

    In my testing expereinces, you cannot use java.util.Date and set a timezone. These objects do not contain any timezone information. I was able to get around this by instead using a calendar object. You can see an example below.

     

     

    ${= Calendar.getInstance(TimeZone.getTimeZone('GMT')).format("EEE, dd MMM yyyy HH:mm:ss z")}