当前位置:网站首页>Timestamp transform to standard time format
Timestamp transform to standard time format
2022-06-10 02:43:00 【Roam-G】
Catalog
Time stamp -> Standard time format
What is the timestamp ?
Popular understanding is to prove the verifiable seal of time , For example, I want to take pictures , How to prove time , Beating the clock is obviously impossible to prove , We can prove it by shooting news newspapers and lottery numbers . Let's introduce the timestamp in detail ?
Time stamp means Greenwich mean time 1970 year 01 month 01 Japan 00 when 00 branch 00 second ( Beijing time. 1970 year 01 month 01 Japan 08 when 00 branch 00 second ) The total number of seconds since .
1. Self built timestamp : This kind of timestamp is received through the time receiving device ( Such as GPS,CDMA, Beidou satellite ) To get the time stamp on the server , And issue the timestamp certificate through the timestamp server . This time stamp can be used to identify the internal responsibility of the enterprise , It has no legal effect at the time of court Certification . Because it may be tampered when receiving time through the time receiving device , Therefore, it cannot be used as a legal basis .
2. A legally valid timestamp : It is a third-party trusted timestamp authentication service in China, which is built by the national time service center of Chinese Academy of Sciences and Beijing United trust Technology Service Co., Ltd . The national time service center is responsible for time service and punctuality monitoring . Because of its punctual monitoring function, the time in the timestamp certificate is guaranteed to be accurate and not tampered with . The platform for obtaining time stamp is “ Mass copyright protection platform ”[1] , It can be synchronized with the national time service center of Chinese Academy of Sciences .
Time stamp -> Standard time format

1. Back end transformation
for(int i=0;i<list.size();i++) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 1- createTime Creation time 2- timeLastModified Last modified 3- cutPaymentTime VIP Due date
String dateString1 = simpleDateFormat.format(list.get(i).getCreateTime());
list.get(i).setCreateTime2(dateString1);
// 2.
String dateString2 = simpleDateFormat.format(list.get(i).getTimeLastModified());
list.get(i).setTimeLastModified2(dateString2);
// 3.
String dateString3 = simpleDateFormat.format(list.get(i).getCutPaymentTime());
list.get(i).setCutPaymentTime2(dateString3);
}2. Front end transformation
<li class="pct12 fsize14 bold" style="text-align:right;"> Creation time :</li>
<li class="pct38">
{
{orderObj.createTime>0?Commutil.date_subStr($globals.getFormatDate(orderObj.createTime),16):''}}
</li>
<li class="pct12 fsize14 bold" style="text-align:right;"> Last modified :</li>
<li class="pct38">
{
{orderObj.timeLastModified>0?Commutil.date_subStr($globals.getFormatDate(orderObj.timeLastModified),16):''}}
</li>
@RequestMapping(value = "/findAllCompany", method = RequestMethod.POST)
@ApiOperation(value = " Query all enterprise information ")
@ApiImplicitParams({@ApiImplicitParam(name = "find", value = " Incoming parameter ", required = true, paramType = "body", dataType = "TbCompany")})
public ResultCode<TbCompany> findAllCompany(@RequestBody TbCompany find) {
ResultCode<TbCompany> rc = new ResultCode<TbCompany>();
try {
// Get login information
CacheEmployee ce = (CacheEmployee) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal();
// If the employee is not a service provider
if(ce == null) {
rc.setCode(CommonEnum.NO_PERMISSION.getCode());
rc.setMsg(CommonEnum.NO_PERMISSION.getMsg());
return rc;
}
if(99!=ce.getUserType()) { // Caravan staff
rc.setCode(CommonEnum.NO_PERMISSION.getCode());
rc.setMsg(CommonEnum.NO_PERMISSION.getMsg());
return rc;
}
Map<String, Object> params = new HashMap<String, Object>();
if(Sys.isCheckNull(find.getId()) > 0) {
params.put("ids", Sys.isCheckNull(find.getId()));
}
if(Sys.isCheckNull(find.getName()) !="") {
params.put("namesLike", Sys.isCheckNull(find.getName()));
}
if(Sys.isCheckNull(find.getStatus()) ==1) {
params.put("statuss", "1");// The query is normal
}
if(Sys.isCheckNull(find.getStatus()) ==2) {
params.put("statuss", "2");// Query deactivation
}
params.put("findallparams", "all");// Query all
if(Sys.isCheckNull(find.getPage())<=0) {
find.setPage(1);
}
if(Sys.isCheckNull(find.getPageSize())<=0) {
find.setPageSize(50);
}else if(2 == find.getFlagExcel()) {
find.setPageSize(50000);
}
// Add export Excel file 2 export ,1 Search for
params.put("startNum", Sys.getStartNum(find.getPage(), find.getPageSize()));
params.put("pageSize", find.getPageSize());
int count = companyService.findCompanyCount(params);
if(count > 0) {
List<TbCompany> list = companyService.findCompany(params);
if(list != null && list.size() > 0) {
rc.setTotalNum(count);
rc.setCode(CommonEnum.SUCCESS.getCode());
rc.setMsg(CommonEnum.SUCCESS.getMsg());
// Judge here , Modify the time format of the incoming front end . If flagExcel ==2. hold Time stamp Change to Standard time .
if(2==find.getFlagExcel()) {
// Need to export , Change time format Commutil.date_subStr($globals.getFormatDate(item.timeLastModified),16):''
for(int i=0;i<list.size();i++) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 1- createTime Creation time 2- timeLastModified Last modified 3- cutPaymentTime VIP Due date
String dateString1 = simpleDateFormat.format(list.get(i).getCreateTime());
list.get(i).setCreateTime2(dateString1);
// 2.
String dateString2 = simpleDateFormat.format(list.get(i).getTimeLastModified());
list.get(i).setTimeLastModified2(dateString2);
// 3.
String dateString3 = simpleDateFormat.format(list.get(i).getCutPaymentTime());
list.get(i).setCutPaymentTime2(dateString3);
}
}else {
// No need to export , Don't change .
// rc.setDatas(list);
}
rc.setDatas(list);
Page page = new Page(find.getPage(), find.getPageSize(), count);
rc.setPop(page);
}else {
rc.setCode(CommonEnum.NO_DATA.getCode());
rc.setMsg(CommonEnum.NO_DATA.getMsg());
}
}else {
rc.setCode(CommonEnum.NO_DATA.getCode());
rc.setMsg(CommonEnum.NO_DATA.getMsg());
}
} catch (SQLException e) {
rc.setCode(CommonEnum.SQL_EXCEPTION.getCode());
rc.setMsg("SQLException:" + e.getMessage());
} catch (Exception e) {
rc.setCode(CommonEnum.OTHER_EXCEPTION.getCode());
rc.setMsg("Exception:" + e.getMessage());
}
return rc;
}边栏推荐
- pixi. JS explosion effect
- pycharm中numpy的安装与使用
- Mysql database user permission management
- mysql 8.0.29 winx64. Graphic tutorial of zip installation and configuration method
- Obtain the name of the province or city 【 project mall 】
- Lm03 who told you that cross species must be arbitraged?
- 在子集合中第一个元素是由另一个数组插入的
- Latex doesn't break lines. Strange
- MySQL installation + test connection + common terminal MySQL commands (super detailed)
- Is the 2022 PMP Exam 3A good? Here is the script
猜你喜欢

Get the list of provinces and cities 【 project mall 】

Eight honors and eight disgraces of programmers' daily development

WPS adjust text spacing

2. Introduction au traitement du langage naturel

Opengauss "user story" is officially launched! One click to share practical experience, Limited Edition Gift waiting for you

Cordova website packaging_ Cordova packaging website

成为白帽大神 | 挑战 openGauss漏洞奖励计划

Antinomy between brand and product

3D reconstruction system | L2 camera model

SSL证书安装后网站还是显示不安全
随机推荐
2、自然語言處理入門
How to do enterprise digital transformation? Three fusions and three transformations
在子集合中第一個元素是由另一個數組插入的
复杂模型机实验
Taobao applet 2048 games
三维重建系统 | L2相机模型
pixi. JS explosion effect
Internal resources of stm32
Cordova development, prompt net:: err_ CLEARTEXT_ NOT_ PERMITTED
Introduction to 51 single chip microcomputer infrared communication
双指针 | 283. 移动零
DataFrame日期数据处理
Double pointer | 27 Removing Elements
大学生 生活小技巧:利用插件(Tampermonkey )学习网课 | 查题
3. NLP model
Double pointer | 977 Square of ordered array
51 Introduction au micro - ordinateur à puce unique - - communication infrarouge
Is it safe for green Dahua futures to open an account? Where can I open an account?
MySQL 8.0.28 installation and configuration method graphic tutorial (compressed package method)
STM32的内部资源