使用SimpleDateFormat 将毫秒转换成时分秒 格式:HH:mm:ss
2018-11-19 21:48
239 查看
public static String dateFormatFromMilliSecond(long seconds) {
//初始化format格式
SimpleDateFormat dateFormat= new SimpleDateFormat("HH:mm:ss");
//设置时区,跳过此步骤会默认设置为"GMT+08:00" 得到的结果会多出来8个小时
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
String time= dateFormat.format(seconds);
return time;
}
相关文章推荐
- 毫秒转换成时分秒 格式:HH:mm:ss Java兑现
- 时间戳格式化转换为日期格式,date.Format('yyyy/MM/dd hh:mm:ss')
- Java日期转换 SimpleDateFormat格式(年月日时分秒)
- 时间转换的好用方法(好招1)//Date date = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2007-09-21 11:00:10.0100");
- Android 使用SimpleDateFormat以及Calendar转换时间为12小时制和24小时制时间格式
- SimpleDateFormat得到完整时间 HH:mm:ss 的方法
- 利用SimpleDateFormat 和MessageFormat 向数据库中插入yyyy-mm-dd 和yyyy-MM-dd HH:mm:ss的日期格式
- Java时间工具--根据毫秒数按照时分秒格式“HH:mm:ss”显示
- SimpleDateFormat使用详解及与毫秒的相互转换
- SpringMVC接收DATE数据@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")的使用
- 秒转 时间格式 JavaScript seconds to time with format hh:mm:ss
- 获取任意格式的new date,如yyyy-mm-dd、yyyy-mm等等,只需要SimpleDateFormat的formate(Date)和parse(String)两个函数即可
- Excel将秒转换成标准的时间格式HH:MM:SS
- 将毫秒转换为时间(HH:ss:mm)
- SimpleDateFormat转换时间,12,24时间格式
- 时间格式2016-12-12 12:32:12.0带毫秒转换正常yyyy-MM-dd HH:mm:ss
- SimpleDateFormat转换时间,12,24时间格式
- java中将毫秒转化为hh:mm:ss的时间格式
- 使用DateUtils和DateFormatUtils处理时间日期转换与SimpleDateFormat的区别
- 日期格式问题NLS_DATE_FORMAT = ''yyyy-mm-dd HH24:MI:SS''