Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
121ba2a6
Commit
121ba2a6
authored
Feb 29, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工具类调整
parent
b95ca88a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
pom.xml
pom.xml
+1
-0
DateUtil.java
...om/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
+18
-0
No files found.
pom.xml
View file @
121ba2a6
...
...
@@ -107,6 +107,7 @@
<module>
yifu-msg
</module>
<module>
yifu-permission
</module>
<module>
yifu-ekp
</module>
<module>
yifu-nginx-log
</module>
</modules>
<dependencyManagement>
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
View file @
121ba2a6
...
...
@@ -73,6 +73,10 @@ public class DateUtil {
* yyyy-MM-dd hh:mm:ss
*/
public
static
final
String
DATETIME_PATTERN_MINUTE
=
"yyyy-MM-dd HH:mm"
;
/**
* yyyy-MM-dd-hh
*/
public
static
final
String
DATETIME_PATTERN_HOUR
=
"yyyyMMddHH"
;
/**
* yyyyMMddHHmmss
*/
...
...
@@ -478,6 +482,20 @@ public class DateUtil {
return
cal
.
getTime
();
}
/**
* @param date
* @param mnt
* @return java.util.Date
*/
public
static
String
dateIncreaseByHour
(
Date
date
,
int
mnt
,
String
fmt
)
{
Calendar
cal
=
GregorianCalendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"GMT"
));
cal
.
setTime
(
date
);
cal
.
add
(
Calendar
.
HOUR
,
mnt
);
return
dateToString
(
cal
.
getTime
(),
fmt
);
}
/**
* @param date
* @param mnt
...
...
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