実装 - Implementation TimestampUtil.java import java.sql.Timestamp; import java.text.SimpleDateFormat; public class TimestampUtil { public static String formattedTimestamp(Timestamp timestamp, String timeFormat) { return new SimpleDateFormat(timeFormat).format(timestamp); } public static Timestamp current() { return new Timestamp(System.currentTimeMillis()); } } 実行結果 - Execution result TimeControlle