public class JoeyUtil extends Object
| 构造器和说明 |
|---|
JoeyUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
dateToStamp(String s)
将时间转换为时间戳
|
static Date |
fomartDate(Long time)
将Long 类型的时间戳转换为Date类型时间
|
static Date |
getTimeByDay(Integer day)
获得当天时间加上自定义天数(Integer day)
|
static Date |
getTimesByDay(Integer day)
获得当天0点时间加上自定义天数(Integer day)
|
static Date |
getTimesmorning()
获得当天0点时间
|
static String |
NullOrUndefined(String flag)
如果为空或undefined返回空
|
static String |
parseTxtByRN(String myString)
Java 替换字符串中的回车换行符
|
static boolean |
regex(String regex,
CharSequence input)
正则表达式验证
|
static Long |
stampDate(Date date,
String format)
将时间转换为Long类型的时间戳
|
static Date |
stampToDate(String s)
将时间戳转换为日期
|
static String |
stampToDateString(String s)
将时间戳转换为时间
|
static String |
stampToDateString(String s,
String dataFormat)
将时间戳转换为时间
|
static byte[] |
toByteArray(Object obj)
ToByteArray
|
static Object |
toObject(byte[] bytes)
ToObject
|
public static String NullOrUndefined(String flag)
flag - Stringpublic static String parseTxtByRN(String myString)
myString - 原字符串public static boolean regex(String regex, CharSequence input)
regex - 正则表达式input - 字符串public static long dateToStamp(String s) throws ParseException
s - 时间ParseExceptionpublic static String stampToDateString(String s, String dataFormat)
s - 时间戳dataFormat - 格式化public static Date getTimesmorning()
public static Date getTimesByDay(Integer day)
day - 自定义天数public static Date getTimeByDay(Integer day)
day - 自定义天数public static Long stampDate(Date date, String format) throws NumberFormatException, ParseException
date - NumberFormatExceptionParseExceptionpublic static byte[] toByteArray(Object obj)
obj - Objectpublic static Object toObject(byte[] bytes)
bytes - byte[]Copyright © 2017. All rights reserved.