mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-06 11:06:58 +00:00
权限增加、移除功能
This commit is contained in:
@ -1,17 +1,27 @@
|
||||
package gg.frog.mc.permissionstime.utils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.time.DateFormatUtils;
|
||||
|
||||
public class StrUtil {
|
||||
|
||||
private static String dfs = "yyyy/MM/dd HH:mm:ss";
|
||||
|
||||
public static String messageFormat(String src, Object... args) {
|
||||
return MessageFormat.format(src, args).replace("&", "§");
|
||||
}
|
||||
|
||||
public static String timestampToString(long time) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
return sdf.format(new Date(time));
|
||||
return DateFormatUtils.format(new Date(time), dfs);
|
||||
}
|
||||
|
||||
public static String dateToString(Date d) {
|
||||
return DateFormatUtils.format(d, dfs);
|
||||
}
|
||||
|
||||
public static String nowTimeString() {
|
||||
return DateFormatUtils.format(new Date(), dfs);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user