Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
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
liyuan
byit-myth-job
Commits
d114f545
Commit
d114f545
authored
Nov 04, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..
parent
80aef7ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
DateUtil.java
...ore-common/src/main/java/com/byit/job/utils/DateUtil.java
+4
-11
No files found.
byit-myth-core/myth-core-common/src/main/java/com/byit/job/utils/DateUtil.java
View file @
d114f545
package
com
.
byit
.
job
.
utils
;
import
cn.hutool.core.date.DateTime
;
import
com.byit.annotation.annotationselector.NotNull
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -140,9 +141,8 @@ public class DateUtil {
* @return 标准时间类型
*/
public
static
Date
strFormatDate
(
String
dateStr
,
String
dateFormat
){
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
dateFormat
);
LocalDateTime
parse
=
LocalDateTime
.
parse
(
dateStr
,
dtf
);
return
localDateTimeToDate
(
parse
);
DateTime
dateTime
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
parse
(
dateStr
,
dateFormat
);
return
dateTime
.
toJdkDate
();
}
/**
...
...
@@ -215,14 +215,7 @@ public class DateUtil {
public
static
void
main
(
String
[]
args
)
{
String
hh
=
DateUtil
.
dateFormat
(
new
Date
(),
"HH"
);
System
.
out
.
println
(
hh
);
String
thisDateStr
=
DateUtil
.
dateFormat
(
new
Date
(),
"yyyyMMdd"
);
String
test
=
thisDateStr
+
" "
+
hh
+
":00:00"
;
System
.
out
.
println
(
test
);
Date
date
=
DateUtil
.
strFormatDate
(
test
,
"yyyyMMdd HH:mm:ss"
);
System
.
out
.
println
(
DateUtil
.
dateFormat
(
date
,
"yyyy-MM-dd HH:mm:ss"
));
System
.
out
.
println
(
strFormatDate
(
"2020121208"
,
"yyyyMMddHH"
));
}
}
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