Class TimestampHelper

java.lang.Object
tigase.util.datetime.TimestampHelper

public class TimestampHelper extends Object
Author:
andrzej
  • Constructor Details

    • TimestampHelper

      public TimestampHelper()
      Creates helper configured to produce timestamps in UTC timezone.
      See Also:
    • TimestampHelper

      public TimestampHelper(boolean useUTC)
      Creates helper configured to produce timestamps in UTC timezone or local timezone.
      Parameters:
      useUTC - true to use UTC timezone, false to use local timezone.
      See Also:
  • Method Details

    • format

      public String format(Date ts)
    • formatInLegacyDelayedDelivery

      public String formatInLegacyDelayedDelivery(Date date)
    • formatWithMs

      public String formatWithMs(Date ts)
    • isUseUTC

      public boolean isUseUTC()
    • setUseUTC

      public void setUseUTC(boolean useUTC)
      If false then generated timestamps will be in local timezone. In other case UTC will be used. true by default.
      Parameters:
      useUTC - true to use UTC timezone, false to use local timezone.
    • parseTimestamp

      public Date parseTimestamp(String tmp) throws ParseException
      Throws:
      ParseException