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
638e6dcb
Commit
638e6dcb
authored
Nov 03, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
f66593f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+5
-7
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
638e6dcb
...
...
@@ -17,9 +17,12 @@ import java.util.Date;
*/
public
class
DateHelper
{
private
static
final
String
FORMAT_YEAR_STRING
=
"yyyy-01-01"
;
private
static
final
String
FORMAT_MONTH_STRING
=
"yyyy-MM-01"
;
private
static
final
String
FORMAT_DAY_STRING
=
"yyyy-MM-dd"
;
private
static
final
String
FORMAT_DAY_HOUR_STRING
=
"yyyy-MM-dd HH:00:00"
;
private
static
final
String
FORMAT_SECOND_STRING
=
"yyyy-MM-dd HH:mm:ss"
;
private
static
final
int
MONTH_1
=
1
;
private
static
final
int
MONTH_2
=
2
;
private
static
final
int
MONTH_3
=
3
;
...
...
@@ -278,9 +281,7 @@ public class DateHelper {
* @return 返回的日期
*/
public
static
Date
getMonthStart
(
Date
date
)
{
Calendar
cal
=
getDayCalendarBegin
(
date
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
cal
.
getTime
();
return
DateHelper
.
getDateTime
(
getDate
(
date
,
FORMAT_MONTH_STRING
));
}
/**
...
...
@@ -302,10 +303,7 @@ public class DateHelper {
* @return 返回值
*/
public
static
Date
getYearStart
(
Date
date
)
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
set
(
cal
.
get
(
Calendar
.
YEAR
),
0
,
0
,
0
,
0
,
0
);
return
cal
.
getTime
();
return
DateHelper
.
getDateTime
(
getDate
(
date
,
FORMAT_YEAR_STRING
));
}
/**
...
...
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