public class TimeConvertUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DAY |
static int |
MONTH |
static String[] |
strs |
static int |
WEEK |
static int |
YEAR |
| Constructor and Description |
|---|
TimeConvertUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertXTimeAgo(Date myDate,
String format) |
static String |
convertXTimeAgo(Date myDate,
String format,
int limit) |
static String |
convertXTimeAgo(Date myDate,
String format,
Locale locale) |
static String |
convertXTimeAgo(Date myDate,
String format,
Locale locale,
int limit)
Convert date to display string with format X time ago
|
static String |
convertXTimeAgoByTimeServer(Date myDate,
String format,
Locale locale,
int limit)
Convert date to display string with format X time ago
|
static String |
getFormatDate(Date myDate,
String format) |
static String |
getFormatDate(Date myDate,
String format,
Locale locale) |
static Calendar |
getGreenwichMeanTime()
Get current time GMT/Zulu or UTC,(zone time is 0+GMT)
|
static Locale |
getLocale()
Get current
Locale |
static String |
santializeJavaVariable(String input)
Cleanup the string to be valid of Java variable
Ex: input = "123 sdkjh s;:sdlkjh d"
output = "_123_sdkjh_s__sdlkjh_d"
|
public static String[] strs
public static int DAY
public static int WEEK
public static int MONTH
public static int YEAR
public static String convertXTimeAgoByTimeServer(Date myDate, String format, Locale locale, int limit)
myDate - The object date input for convert, it must has ZoneTime is server ZoneTimeformat - The date/time formatlocale - The Local of current location(language/country).limit - The value set for limit convert x time ago. It must is: TimeConvertUtils.YEAR, MONTH, WEEK, DAY.public static String convertXTimeAgo(Date myDate, String format, Locale locale, int limit)
myDate - The object date input for convert, it must has ZoneTime is GMT+0format - The date/time formatlocale - The Local of current location(language/country).limit - The value set for limit convert x time ago. It must is: TimeConvertUtils.YEAR, MONTH, WEEK, DAY.public static Calendar getGreenwichMeanTime()
Copyright © 2003–2018 eXo Platform SAS. All rights reserved.