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
89d894df
Commit
89d894df
authored
Apr 13, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default Changelist
parent
60b6d1dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+17
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
89d894df
...
@@ -21,6 +21,7 @@ public class DateHelper {
...
@@ -21,6 +21,7 @@ public class DateHelper {
public
static
final
String
FORMAT_MONTH_STRING
=
"yyyy-MM-01"
;
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_DAY_STRING
=
"yyyy-MM-dd"
;
public
static
final
String
FORMAT_TIME_STRING
=
"HH:mm:ss"
;
public
static
final
String
FORMAT_TIME_STRING
=
"HH:mm:ss"
;
public
static
final
String
INIT_TIME
=
"00:00:00"
;
public
static
final
String
FORMAT_DAY_HOUR_STRING
=
"yyyy-MM-dd HH:00:00"
;
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"
;
public
static
final
String
FORMAT_SECOND_STRING
=
"yyyy-MM-dd HH:mm:ss"
;
...
@@ -37,6 +38,22 @@ public class DateHelper {
...
@@ -37,6 +38,22 @@ public class DateHelper {
private
static
final
int
MONTH_11
=
11
;
private
static
final
int
MONTH_11
=
11
;
private
static
final
int
MONTH_12
=
12
;
private
static
final
int
MONTH_12
=
12
;
/**
* 判断时间是否是初始化时间
*
* @param time 历史初始化日期
* @return 新的日期
*/
public
static
final
boolean
isInitTime
(
String
time
)
{
if
(
StringHelper
.
isEmpty
(
time
))
{
return
true
;
}
if
(
StringHelper
.
compare
(
time
,
INIT_TIME
.
substring
(
0
,
time
.
length
())))
{
return
true
;
}
return
false
;
}
/**
/**
* 判断日期是否需要初始化,当需要时,返回新的日期
* 判断日期是否需要初始化,当需要时,返回新的日期
*
*
...
...
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