[置顶] scala获取当前时间戳和今天0时时间戳(精确到秒)的小工具
2016-10-21 17:52
309 查看
package com.unicom import java.text.SimpleDateFormat import java.util.Date /** * Created by Administrator on 2016/10/21. */ object TimeUtils { val now = new Date() def getCurrent_time(): Long = { val a = now.getTime var str = a+"" str.substring(0,10).toLong } def getZero_time():Long={ val dateFormat = new SimpleDateFormat("yyyy-MM-dd") val a = dateFormat.parse(dateFormat.format(now)).getTime var str = a+"" str.substring(0,10).toLong } }
相关文章推荐
- 如何获取精确到毫秒的当前时间以及 日期与时间的相互转化
- 获取当前时间若干年、月、日、时等工具时间工具类
- java获取当前时间精确到毫秒
- Linux获取系统当前时间(精确到毫秒)
- [置顶] windows/linux 获取本地时间(精确到微妙)
- Linux获取系统当前时间(精确到毫秒)
- linux C++ 获取当前时间,以标准时间“年-月-日 时:分:秒”的形式输出,且秒后边跟小数精确到毫秒
- linux下获取当前时间(精确到毫秒)
- [置顶] android开发之java代码中如何获取到当前时间。详情代码带注释。
- 【小工具】获取当前时间
- JAVA获取当前时间精确到毫秒
- VB.NET获取系统当前精确时间(毫秒级)
- Linux获取系统当前时间(精确到毫秒)
- sqlite 获取当前时间 精确到毫秒
- C++获取系统当前时间(精确到微秒)
- 如何获取精确到毫秒的当前时间以及 日期与时间的相互转化
- 获取系统当前时间(精确到毫秒)
- Linux获取系统当前时间(精确到毫秒)
- [置顶] Js获取当前日期时间及其它操作
- Linux 下c获取当前时间(精确到秒和毫秒或者微秒)