Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
c1063d50
Commit
c1063d50
authored
Sep 14, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
5d39575f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+13
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
c1063d50
...
...
@@ -20,6 +20,7 @@ public class DateHelper {
public
static
final
String
FORMAT_YEAR_END_STRING
=
"yyyy-12-31"
;
public
static
final
String
FORMAT_MONTH_STRING
=
"yyyy-MM-01"
;
public
static
final
String
FORMAT_DAY_STRING
=
"yyyy-MM-dd"
;
public
static
final
String
FORMAT_TIME_STRING
=
"HH:mm:ss"
;
public
static
final
String
FORMAT_DAY_HOUR_STRING
=
"yyyy-MM-dd HH:00:00"
;
public
static
final
String
FORMAT_SECOND_STRING
=
"yyyy-MM-dd HH:mm:ss"
;
...
...
@@ -757,6 +758,18 @@ public class DateHelper {
return
to
;
}
/**
* 获取时间为指定格式的字符串,为null则返回空字符串
*
* @param format 格式 yyyy-MM-dd HH:mm:ss
* @param date 字符串
* @return 转换后的结果
*/
public
static
String
getDateTimeString
(
String
format
,
String
date
)
{
Date
dt
=
getDateTime
(
date
);
return
getDateTimeString
(
format
,
dt
);
}
/**
* 比较时间
*
...
...
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