package com.fanxin.app.fx.others; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class TimeUtils { public static String getCurrentTime(String format) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault()); String currentTime = sdf.format(date); return currentTime; } public static String getCurrentTime() { return getCurrentTime("yyyy-MM-dd HH:mm:ss"); } }