public class TimeUtil
extends java.lang.Object
| Constructor and Description |
|---|
TimeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.joda.time.format.DateTimeFormatter |
toDateTimeFormatter(java.lang.String formatName,
java.lang.String timeFormat)
Converts the given time format string to a
DateTimeFormatter instance. |
static java.lang.String |
toString(long millis,
java.lang.String format)
Converts the given epoch time in millisecond to a string according to the given format.
|
public static org.joda.time.format.DateTimeFormatter toDateTimeFormatter(java.lang.String formatName,
java.lang.String timeFormat)
DateTimeFormatter instance.formatName - A name used to identify the given time format. This is mainly used for error reporting.timeFormat - The date time format to be converted.DateTimeFormatter instance of the given time format.java.lang.IllegalArgumentException - if the given time format is invalid.public static java.lang.String toString(long millis,
java.lang.String format)
DateTimeFormatter instance, which is pretty costly.
This method is suitable for testing and calls that are not on hot path.millis - the epoch time to be convertedformat - The format the returned time string