The current time was 10:30 AM.
{{now. shortDateTime}} in a text field resolved to 2:30 PM
A setting in System is:
Default user time zone (GMT-05:00) New York
Dates and times are stored in Jira Cloud in GMT. You are seeing the current GMT time.
With Daylight Savings Time in the U.S., New York is actually only 4 hours behind GMT. It is 5 hours behind GMT when Standard Time is in effect.
Thank you for your answer, but I am unfortunately not understanding it.
The correct time displays in date/time fields after post-transition actions use %%CURRENT_DATETIME%%, but in an automation that resolves smart value {{now. shortDateTime}}, in a text field, the time displayed in the text field is 5 hours later. 4 hours later would still not be usable.
The setting I see in Sandbox > System is Default user time zone (GMT-05:00) New York, which I interpret as NY (Eastern) time. A discrepancy of one hour doesn't solve my problem, and if that were the problem, I would not know how to correct it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You stated:
The current time was 10:30 AM.
{{now. shortDateTime}} in a text field resolved to 2:30 PM
That is a difference of 4 hours.
For consistency date/times are stored in the Jira database as GMT/UTC, so date/time smart values like {{now}} return the GMT/UTC time. That is why your smart value is showing the current time in terms of GMT/UTC.
You said the Default User Time Zone is (GMT-05:00). The stated timezones don't adjust for Daylight Savings Time. The difference between GMT and New York during Standard Time months in the U.S. is 5 hours. During Daylight Savings Time months the difference is only 4 hours. You can see this with apps/websites that show you the time in different timezones, such as
https://dateful.com/time-zone-converter
So, while the time per your time zone setting (GMT -5:00) is 10:xx am, the value for {{now}} will be 2:xx pm during Daylight Savings Time months. That is the answer to the question you asked.
You have not stated what the problem is with the field displaying the GMT/UTC time rather than the equivalent time for your timezone preference.
If you want to convert the value from GMT/UTC to a specific time zone before storing it in the text field you can use the convertToTimeZone function documented on this page.
Example:
{{now.convertToTimeZone("Australia/Sydney").shortTime}}
Since the users of your system may have set different timezone preferences than the default, if you do convert the value to a specific timezone you may want to tack on text in that field that indicate which time zone the value is for.
(Side note: when you are viewing issues in the UI, Jira automatically converts the values shown in date/time fields from the stored UTC/GMT value to the time zone preference selected by the user.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. While I'm waiting for my Tech Support to allow the URL in the link provided for valid inputs for time zone, if you know the input for US Eastern, please provide it. My guess didn't work: {{now.convertToTimeZone("New York").shortTime}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
America/New_York
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
:-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there an official timezone list like the above "America/New_York" suggested above by @Trudy Claspill ? I'd love to see it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the Jira documentation regarding smart values for date/time
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
...under the section for the convertToTimeZone function there is a link to the Time zone values that are valid.
http://joda-time.sourceforge.net/timezones.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Trudy Claspill
I wanted the date to render as "Thursday, June 28, 2023 at 4:00pm EST" and was able to accomplish this for a custom date/time field.
{{issue.customfield_10928.convertToTimeZone("America/New_York").format("EEEE, MMMM d, yyyy 'at' h:mma")}}
And it works perfectly! I'm using it in an automated email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.