Class SqlTimestampConverter

java.lang.Object
com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter
com.thoughtworks.xstream.converters.extended.SqlTimestampConverter
All Implemented Interfaces:
ConverterMatcher, SingleValueConverter

public class SqlTimestampConverter extends AbstractSingleValueConverter
Converts a Timestamp to a string.
  • Field Details

  • Constructor Details

    • SqlTimestampConverter

      public SqlTimestampConverter()
      Constructs a SqlTimestampConverter using UTC format.
    • SqlTimestampConverter

      public SqlTimestampConverter(TimeZone timeZone)
      Constructs a SqlTimestampConverter.

      XStream uses by default UTC as time zone. However, if the resulting XML is used as feed for a data base (like MS SQL) the server might expect the timestamp to be in local time and does the conversion to UTC on its own. In such a case you can register an own instance of the SqlTimestamp converter using e.g. TimeZone.getDefault().

      Parameters:
      timeZone - the time zone used for the format
      Since:
      1.4.10
  • Method Details