This commit is contained in:
Redkale
2016-10-19 17:37:37 +08:00
parent 55e2109764
commit b5011fa069

View File

@@ -24,7 +24,7 @@ public final class Utility {
private static final int zoneRawOffset = TimeZone.getDefault().getRawOffset();
private static final String format = "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%tL";
private static final String format = "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS";
private static final Charset UTF_8 = Charset.forName("UTF-8");
@@ -88,10 +88,6 @@ public final class Utility {
return UUID.randomUUID().toString().replace("-", "");
}
public static String now() {
return String.format(format, System.currentTimeMillis());
}
public static String toString(String string, ByteBuffer buffer) {
if (buffer == null || !buffer.hasRemaining()) return string;
int pos = buffer.position();
@@ -157,6 +153,14 @@ public final class Utility {
return back;
}
public static String now() {
return String.format(format, System.currentTimeMillis());
}
public static String formatTime(long time) {
return String.format(format, time);
}
/**
* 获取当天凌晨零点的格林时间
*