How to use Directives to set a date time that is relative to a nominated time zone

If you are setting DateTime custom fields with directives via JEMHC, the timezone that such times are created in will be related to your instance system time, which, being cloud hosted in (for hosts we looked at GMT-4).  Which results in dates set slightly 'out' from the expected, compounding this problem.

Step-by-step guide

  1. Check your JIRA default time-zone in JIRA Admin > System > General Settings > : Default user time zone.  NOTE that a users Profile selection will override the system default and vary how a given time is shown, assuming the Profile is the same as the system default (in this example, PST which is GMT-8)

  2. Set _JEMHC > Licensing > Host Information >_ *Time Zone* : PST (GMT -8)

  3. Using a Directive (assumes knowledge of Directives and Field Processors in JEMHC to manipulate JIRA issue fields) set set a nominated field 'My Date Time' with the value:

    @My Date Time=25/Nov/15 12:00 AM
  4. Gives a report output of

    Value '25/Nov/15 12:00 AM' of directive for field customfield_11400 will be parsed using formats dd/MM/yy h:mm a (System Date Time Format), dd/MMM/yy h:mm a (System Date Time Format), d/MM/yy (System Date Format), d/MMM/yy (System Date Format) in order. Directive 'My Date Time' has been applied. Resolved value is '2015-11-25T08:00:00.000+0000'.
  5. The following will be viewed on the issue:

    My Date Time: 25/Nov/15 12:00 AM

Related articles