Date format for timestamp in WebMethods

I am trying to create Event Timestamp as per the below format:- 2021-04-05T06:39:33.931-07:00

I tried using the below pattern for the same: yyyy-MM-dd'T'HH:mm:ss.SSSZZZZ

Unfortunately, the output is not the same. Below is the output for the same:
image

Can you please suggest what should be the correct pattern for this? Below is the code block where I am putting the inputs:-

Hello Atul,

Can you try yyyy-MM-dd’T’HH:mm:ss.SSSz as pattern , which will give the below value as the result.

2021-05-25T15:57:26.199GMT

Let me if this helps.

Regards,
Bharath

I wanted to have the below as an output value:-

I set the timezone as below and now it is coming as -
image

Is there any pattern which can give me the colon in the timezone? Or should I implement it on my own?

Review the format patterns defined by SimpleDateFormat. You will find what you seek.

Hello Atul,

timezone field is optional, If you do not specify timezone, the value of the server’s “user timezone” property is used. If this property has not been set, GMT is used.

you can look for examples :
https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html

Regards,
Bharath

1 Like