首页天道酬勤毫秒转date,时间戳转换日期

毫秒转date,时间戳转换日期

admin 05-10 18:03 147次浏览

package com.qr.management.util; 导入Java.text.parse exception; 导入Java.text.simple date format; import java.util.Date; 公共类数据{私有类数据} simpledateformatsf=null; /**取得当天的日期yyyymmdd * @ return */publicstaticstringgetstrdate () { Date date=new Date ); simpledateformatsdf=newsimpledateformat (yyymmdd ); 返回SDF.format (date; } /** *系统时间*/publicstaticstringgetcurrentdate () { Date d=new Date ); SF=newsimpledateformat (yyyy-mm-ddhh : mm : ss ); returnSF.format(d; } /** *将时间戳转换为字符串*/publicstaticstringgetdatetostring (long time ) (dated=newdate ) time ); //SF=newsimpledateformat (yyyy-mm-ddhh : mm : ss ); SF=newsimpledateformat (yyyy-mm-DD ); returnSF.format(d; } /** *将字符串作为时间戳*/publicstaticlonggetstringtodate (stringtime ) SF=newsimpledateformat (yyyy-mm-ddhh 3360 mm 3360 SF try{date=SF.parse(time; }catch(parseexceptione ) { e.printStackTrace ); } return date.getTime (; } /** *直接时间戳*/publicstaticstringgettimestamp () string current date=get current date ); SF=newsimpledateformat (yyyy-mm-ddhh : mm : ss ); 日期=new date (; try{date=SF.parse(currentdate ); }catch(parseexceptione ) { e.printStackTrace ); } return string.value of (date.gettime ); }/p

SSH的​SpringMVC注解怎么使用基于Android监听ContentProvider中数据变化的相关介绍C 程序编写之std::forward应用代码分析UGUI实现ScrollView无限滚动效果repositories
时间戳是啥,php时间戳转换中国标准时间 ,
相关内容