TimestampHelper

public class TimestampHelper
Author:andrzej

Constructors

TimestampHelper

public TimestampHelper()

Creates helper configured to produce timestamps in UTC timezone.

See also: TimestampHelper.setUseUTC(boolean)

TimestampHelper

public TimestampHelper(boolean useUTC)

Creates helper configured to produce timestamps in UTC timezone or local timezone.

Parameters:
  • useUTCtrue to use UTC timezone, false to use local timezone.

See also: TimestampHelper.setUseUTC(boolean)

Methods

format

public String format(Date ts)

formatInLegacyDelayedDelivery

public String formatInLegacyDelayedDelivery(Date date)

formatWithMs

public String formatWithMs(Date ts)

isUseUTC

public boolean isUseUTC()

parseTimestamp

public Date parseTimestamp(String tmp)

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:
  • useUTCtrue to use UTC timezone, false to use local timezone.