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

2 votes
Answer accepted
Kishan Sharma
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 Leaders.
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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events