Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-5122

Rest API dates cannot be submitted with timezone information

XMLWordPrintable

      The REST API uses a format without timezone identifier to (de-)serialize dates (format yyyy-MM-dd'T'HH:mm:ss). Thus, by default it uses the System's default timezone (java.util.Timezone#getDefault). In timezones with daylights saving time, it is therefore not possible to specify a date within the change of timezone offsets.

      Example code:

      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
      
      Date before = dateFormat.parse("2015-10-25T01:10:00");
      Date within = dateFormat.parse("2015-10-25T02:10:00");
      Date after = dateFormat.parse("2015-10-25T03:10:00");
      
      System.out.println(before);
      System.out.println(before.getTime());
      System.out.println(within);
      System.out.println(within.getTime());
      System.out.println(after);
      System.out.println(after.getTime());
      

      prints

      Sun Oct 25 01:10:00 CEST 2015 (=> 23:10:00 UTC)
      1445728200000
      Sun Oct 25 02:10:00 CET 2015 (=> 01:10:00 UTC)
      1445735400000
      Sun Oct 25 03:10:00 CET 2015 (=> 02:10:00 UTC)
      1445739000000
      

      => It is not possible to define 00:10:00 UTC

      Solution:

      • allow users to configure date serialization format

        This is the controller panel for Smart Panels app

              thorben.lindhauer Thorben Lindhauer
              thorben.lindhauer Thorben Lindhauer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: