ITPub博客

首页 > 应用开发 > Java > Java UNIX时间转换

Java UNIX时间转换

Java 作者:爱浓 时间:2014-07-01 11:43:43 0 删除 编辑
public static String toLocalTime(String unix) { Long timestamp = Long.parseLong(unix) * 1000; String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date(tmestamp)); return date; } public static String toUnixTime(String local)http://www.huiyi8.com/jiaoben/  JQuery特效 { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String unix = ""; try { unix = df.parse(local).getTime() + ""; } catch (ParseException e) { e.printStackTrace(); } return unix; }

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29702073/viewspace-1200534/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: Android 异步编程
请登录后发表评论 登录
全部评论

注册时间:2014-06-10

  • 博文量
    2
  • 访问量
    4589