背景:最近写一个通过excel批量导入数据的功能,里面含有时间,但是java读取之后把时间转为了距离1990年1月1号的天数,比如excel中时间为2018/9/16 18:30,java读取之后变成43359.77083就会有问题 出现的问题: SimpleDateFormat startFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = startFormat.parse(tmpMap.get(&quo
package lianxi; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class date { public static void main(String[] args) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(" yyyy-MM-dd E
1.建议控制台程序 使用 IntelliJ IDEA 创建 MAVEN项目, 不选别的选项,则为控制台程序. (其它方式创建的控制台程序可能编译不过) 2.源码如下: import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Locale; public class Main { public s