Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1350

Adding hours/mins/secs etc to the duration does not add up correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • util
    • None

    Description

      axis2_char_t *duration_str = "P19Y6M4DT12H30M5S";
      printf("input:%s\n", duration_str);
      axutil_duration_t *duration = NULL;
      axis2_char_t *result = NULL;

      duration = axutil_duration_create_from_string(env, duration_str);
      int hours = axutil_duration_get_hours(duration, env);
      axutil_duration_set_hours(duration, env, hours + 13);
      result = axutil_duration_serialize_duration(duration, env);
      printf("result:%s\n", result);

      The output of the above program should ideally be
      input:P19Y6M4DT12H30M5S
      result:P19Y6M5DT1H30M5.000000S

      But it is actually is
      input:P19Y6M4DT12H30M5S
      result:P19Y6M4DT25H30M5.000000S

      When hours exceed 24 it should be counted as 1 days and 1 hour instead of 25 hours. This problem is there for other time units as well.

      Attachments

        Activity

          People

            Unassigned Unassigned
            damitha Damitha N.M. Kumarage
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: