/**
  * 时间戳
  * @return
  */
 public static String CreateDate(){
  String dataStr=null;
 
  SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
  dataStr = sdf.format(new Date());
  return dataStr;
 }
 /**
  * 失效时间 当前时间+10min
  * @param num
  * @return
  */
 public static String expriredDate(String dataStr){
  String aDataStr=null;
  try {
   SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
   Date date = sdf.parse(dataStr);
   date.setTime(date.getTime()+10*60*1000);
   aDataStr=sdf.format(date);
  } catch (ParseException e) {
   e.printStackTrace();
  }
  return aDataStr;
 }

 

posted on 2017-02-19 19:14  塞北夜莺  阅读(15454)  评论(0编辑  收藏  举报