Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
ZHHT-IRN-BD-ANALYSIS
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李凯旋
ZHHT-IRN-BD-ANALYSIS
Commits
ef754b61
Commit
ef754b61
authored
Nov 28, 2022
by
余根龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加fast
parent
a1a9ccb3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
DateUtils.java
...streaming/src/main/java/com/zhht/irn/utils/DateUtils.java
+18
-1
No files found.
realtime/hologram-streaming/src/main/java/com/zhht/irn/utils/DateUtils.java
View file @
ef754b61
...
...
@@ -222,10 +222,16 @@ public class DateUtils {
return
time
;
}
/**
* 日期转时间戳
*
* @param s
* @return
*/
public
static
Long
dateToStamp
(
String
s
){
try
{
String
res
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
timeFormat
);
Date
date
=
simpleDateFormat
.
parse
(
s
);
long
ts
=
date
.
getTime
();
return
ts
;
...
...
@@ -234,6 +240,17 @@ public class DateUtils {
}
}
/**
* 时间戳转日期(yyyy-MM-dd HH:mm:ss)
*
* @param timestamp
* @return
*/
public
static
String
stampToTime
(
String
timestamp
){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
timeFormat
);
long
date_temp
=
Long
.
valueOf
(
timestamp
);
return
sdf
.
format
(
new
Date
(
date_temp
));
}
/**
* 判断时间是否在当前时间十分钟之类
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment