Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4719

Wrong time when parsing time without time zone information.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Functions public static Date convertToDate(String source) and public static Calendar convertToDateTime(String source) returns wrong time when parsing a data without timezone information.

      When parsing a time without timezone set, default timezone is used, But, daylight saving is always set to zero (instead of using the local default daylight savings also). This gives the wrong time back when the local daylight savings is not zero.

      The fix is to only set daylight savings to zero ( calendar.set(Calendar.DST_OFFSET, 0); ) when the time has time zone information.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            rikard Rikard Swahn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified

                Slack

                  Issue deployment