我有一个字符串x ="1086073200000".这基本上是毫秒,我需要转换为Date.
转换我正在使用
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
long tempo1=Long.parseLong(x);
System.out.println(tempo1); // output is 86073200000 instead of the whole thing
long milliSeconds=1346482800000L;
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(milliSeconds);
System.out.println(formatter.format(calendar.getTime()));
Run Code Online (Sandbox Code Playgroud)
问题是当我将字符串x转换为long时,由于long的大小限制,一些数字会消失.
如何保留整个String.
谢谢.