The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Date is of by 60 days...

Romeo Bollen
March 15, 2024

I created an automation to display a date in tickets that are automaticly created.

{{now.convertToTimeZone("Europe/Rome").format("YYYY-MM-DD")}}

It translates it into  2024-03-75 ?

We are the 15th, I've never experienced a 75+ day month on this planet.

Anybody any clues on what went wrong?

2 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Kishan Sharma
Community Champion
March 15, 2024

Hi @Romeo Bollen 

It appears that the format may not be correct. You can try below:

{{now.convertToTimeZone("Europe/Rome").format("yyyy-MM-dd")}}

 

Romeo Bollen
March 20, 2024

Thank you for the correction.

Like Kishan Sharma likes this
1 vote
Answer accepted
Bill Sheboy
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 Champions.
March 16, 2024

Hi @Romeo Bollen 

That is showing the day-of-year ("D"), and not the day-of-month ("d").

When looking at the documentation for automation functions, they often also provide links to the supporting materials.  In this case, there is also a link to the Java documentation which shows the possible format layouts / characters.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

Kind regards,
Bill

Romeo Bollen
March 20, 2024

Thank you for the full explanation.

Like Bill Sheboy likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events