时间戳服务
This commit is contained in:
@ -1,5 +1,11 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.timeService.tsa;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* CA 时间戳服务接口
|
||||
*
|
||||
@ -60,6 +66,10 @@ public interface TtsAgent {
|
||||
public class TtsParseResult {
|
||||
// 时间
|
||||
private String timestamp;
|
||||
// 时间
|
||||
private Date datestamp;
|
||||
// 时间
|
||||
private LocalDateTime localDateTimestamp;
|
||||
|
||||
// hash 值
|
||||
private String hash;
|
||||
@ -72,6 +82,14 @@ public interface TtsAgent {
|
||||
this.timestamp = timestamp;
|
||||
this.hash = hash;
|
||||
this.cert = cert;
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
this.localDateTimestamp =LocalDateTime.parse(timestamp,dtf);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
this.datestamp = sdf.parse(timestamp);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
|
Reference in New Issue
Block a user