XStream
  1. XStream
  2. XSTR-396

Date timestamps loose timezone

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      JDK 1.6

      Description

      I have an object on my server with has dates. The date on the server are java.util.Date. They are from a database that stores the dates in LA time (GMT-8). I marshal the object with XStream and send it to the client program which unmarshals it back into the object. The client's timezone is not GMT-8 but any other (such as GMT, GMT-3, etc).

      When doing Date.toString () or DateFormat.format (Date), the date is shown without timezone conversion. Upon inspection, I found that on the server, the date is correctly flagged as being in GMT-8. However, on the client, it is marked as being in the current timezone - which it isn't.

      It seems that when the date marshalled, it looses its timezone information.

      Expected behavior is that the date, when shown using Dateformat.format (Date) would be shown in the user's locale - i.e., if it was 1:00AM GMT-8, when shown on a client in GMT, it would show 9:00AM.

        People

        • Assignee:
          Unassigned
          Reporter:
          Etienne
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: