Is there a smart value to convert the created date of a jira ticket to GMT +2

Julia February 10, 2022

I have an automation set up to comment on a ticket the date/time stamp of when it was created. Inside of that comment, in addition to the date/time stamp, I want it to be displayed as well in GMT +2.

It looks like GMT+2 isn't on the list of timezones here: https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html#of-java.lang.String- 

I am also struggling to understand the ZoneOffset normalize() instructions.

What smart value could I use to convert a date/time stamp to GMT+2. I also want it displayed as fullDateTime

I have tried 

{{issue.created.setTimeZone("GMT+2")}}
 

2 answers

1 accepted

1 vote
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2022

Hi @Julia - This worked for me (I used EET because I'm lazy 😉)

{{issue.created.setTimeZone("EET").longDateTime}}
Julia February 10, 2022

Hey Mark - thank you. is EET the same as GMT+2 ?

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2022

Jira documentation pointed me to here and it shows EET as +2:

joda-time.sourceforge.net/timezones.html

Julia February 10, 2022

Thank you so much! 

Like Mark Segall likes this
Julia February 10, 2022

Mark, hate to come back, but I tried that and it is displaying PST 

 

Screen Shot 2022-02-10 at 9.58.59 AM.pngScreen Shot 2022-02-10 at 9.59.55 AM.png

Julia February 10, 2022

Based on the Atlassian document I linked in the initial post, it doesn't look like we can just use any timezone, they have specific ones available 

Julia February 10, 2022
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2022

So the issue is that you need to use convertToTimeZone.  setTimeZone is just applying the desired time zone value, which is kind of a silly smart value to me as I would think you could just hard code it in if you wanted to set that. But I digress... Here's what did the trick for me:

{{issue.created.convertToTimeZone("GMT+2").longDateTime}}
0 votes
Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2022

Here's what worked for me...
(I live and work in Melbourne)


{{created.convertToTimeZone("Australia/Sydney").jqlDateTime}}&nbsp;&nbsp;</td>

Suggest an answer

Log in or Sign up to answer