Package tigase.util.datetime
Class TimestampHelper
- java.lang.Object
-
- tigase.util.datetime.TimestampHelper
-
public class TimestampHelper extends Object
- Author:
- andrzej
-
-
Constructor Summary
Constructors Constructor Description TimestampHelper()Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(Date ts)StringformatInLegacyDelayedDelivery(Date date)StringformatWithMs(Date ts)booleanisUseUTC()DateparseTimestamp(String tmp)voidsetUseUTC(boolean useUTC)Iffalsethen generated timestamps will be in local timezone.
-
-
-
Constructor Detail
-
TimestampHelper
public TimestampHelper()
Creates helper configured to produce timestamps in UTC timezone.- See Also:
setUseUTC(boolean)
-
TimestampHelper
public TimestampHelper(boolean useUTC)
Creates helper configured to produce timestamps in UTC timezone or local timezone.- Parameters:
useUTC-trueto use UTC timezone,falseto use local timezone.- See Also:
setUseUTC(boolean)
-
-
Method Detail
-
isUseUTC
public boolean isUseUTC()
-
setUseUTC
public void setUseUTC(boolean useUTC)
Iffalsethen generated timestamps will be in local timezone. In other case UTC will be used.trueby default.- Parameters:
useUTC-trueto use UTC timezone,falseto use local timezone.
-
parseTimestamp
public Date parseTimestamp(String tmp) throws ParseException
- Throws:
ParseException
-
-