package test; import java.text.SimpleDateFormat; import java.util.Date; import java.util.MissingFormatArgumentException; public class NowTime { public static void main(String[] args) { Date nowDate=new Date(); SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); String str=sdf.format(nowDate); System.out.println(str); } }