public class StringUtil extends Object
限定符和类型 | 字段和说明 |
---|---|
private static DateFormat |
sdf |
构造器和说明 |
---|
StringUtil() |
限定符和类型 | 方法和说明 |
---|---|
static String |
decimals(int place,
double num)
保留指定位数的double小数点
|
static String |
detailNs(long time) |
static String |
getStringTime(long time)
将时间戳转为时间字符串
|
static String |
msPattern(long time)
将毫秒(ms)时间转换为带单位的字符串时间
|
static String |
nsPattern(long time)
将纳秒(ns)时间转换为带单位的格式
|
static double |
nsToMs(long time)
纳秒(ns)转毫秒(ms)
|
private static final DateFormat sdf
public static String getStringTime(long time)
time
- 时间戳public static String decimals(int place, double num)
place
- 小数点位数num
- double数值public static String nsPattern(long time)
time
- 纳秒时间戳public static String msPattern(long time)
time
- ms时间戳public static double nsToMs(long time)
time
- public static String detailNs(long time)
Copyright © 2020. All rights reserved.