atjha
(Atul Kumar Jha)
May 25, 2021, 3:21pm
1
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:
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
atjha
(Atul Kumar Jha)
May 25, 2021, 4:07pm
3
I wanted to have the below as an output value:-
I set the timezone as below and now it is coming as -
Is there any pattern which can give me the colon in the timezone? Or should I implement it on my own?
reamon
(reamon)
May 25, 2021, 4:37pm
4
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
system
(system)
Closed
August 24, 2021, 4:55am
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.