Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Julia
Contributor
February 10, 2022 edited

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 Champion
February 10, 2022

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

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

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

Mark Segall
Community Champion
February 10, 2022

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

joda-time.sourceforge.net/timezones.html

Julia
Contributor
February 10, 2022

Thank you so much! 

Like • Mark Segall likes this
Julia
Contributor
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.png Screen Shot 2022-02-10 at 9.59.55 AM.png

Julia
Contributor
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
Contributor
February 10, 2022
Mark Segall
Community Champion
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
TAGS
atlassian, team ’25 europe, early bird extension, conference discount, barcelona, hybrid event, AI teamwork, early bird pass, digital access, collaboration conference, atlassian events, register now, developer conference

1 week left to save on your Team '25 Europe pass

Still thinking about joining us for Team '25 Europe? Early bird has been extended for just one week! Now’s the time to lock in your lowest rate. Use code TEU25COMM-20 to save 20% at checkout. Hurry, this only lasts for 1 more week.

Learn more
AUG Leaders

Atlassian Community Events