JMWE Cloud: Which time zone is used by default?

JMWE Cloud: Which time zone is used by default?

 Problem

When setting a field with a timestamp generated by JMWE, the process doesn’t use the Jira system time zone.

 Solution

By default, JMWE assumes a UTC +0 time zone unless a time zone has been manually specified. This is typically not an issue when setting a date/time field, as Jira can handle user time zones, but it will display time from another time zone to most users when it’s set to a text field.

To circumvent this issue, you can use Nunjucks date filters to format the time and date. date filter | tz

For example:

  1. {{ now | date('tz') }} outputs the current time for the user that runs the post function and returns it as a Moment.js object. This will be output as Unix time in milliseconds in a text field.

  2. {{ now | date('tz') | date }} outputs the current time in a human-readable format, factoring the post function user’s time zone.

  3. {{ now | date('tz',"Asia/Kolkata") | date('dddd, MMMM Do YYYY, h:mm:ss a') }} displays the current time, assuming the time zone in Kolkata, India, in the specified format dddd, MMMM Do YYYY, h:mm:ss a.

 

 Related articles