Package tigase.util.datetime
Class TimestampHelper
java.lang.Object
tigase.util.datetime.TimestampHelper
- Author:
- andrzej
-
Constructor Summary
ConstructorDescriptionCreates helper configured to produce timestamps in UTC timezone.TimestampHelper
(boolean useUTC) Creates helper configured to produce timestamps in UTC timezone or local timezone. -
Method Summary
Modifier and TypeMethodDescriptionformatWithMs
(Date ts) boolean
isUseUTC()
parseTimestamp
(String tmp) void
setUseUTC
(boolean useUTC) Iffalse
then generated timestamps will be in local timezone.
-
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
-
formatInLegacyDelayedDelivery
-
formatWithMs
-
isUseUTC
public boolean isUseUTC() -
setUseUTC
public void setUseUTC(boolean useUTC) Iffalse
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
- Throws:
ParseException
-