1. 第一种方式 使用 SimpleDateFormat 类 Date now = new Date(); SimpleDateFormat sdf= new SimpleDateFormat("yyyyMMddHHmmss", java.util.Locale.CHINA