Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rym-util
Project
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
zhengqiuyun
rym-util
Commits
ed2c6efb
Commit
ed2c6efb
authored
Nov 28, 2022
by
zhengqiuyun86
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间帮助类新增ParseDateTimeE
parent
84ed9c2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
DateUtil.go
util/DateUtil.go
+3
-2
No files found.
util/DateUtil.go
View file @
ed2c6efb
...
@@ -41,9 +41,10 @@ func ParseDateTime(dateTime string) time.Time {
...
@@ -41,9 +41,10 @@ func ParseDateTime(dateTime string) time.Time {
return
stamp
return
stamp
}
}
func
ParseDateTimeE
(
dateTime
string
)
(
time
.
Time
,
error
)
{
func
ParseDateTimeE
(
dateTime
string
,
name
string
)
time
.
Time
{
stamp
,
err
:=
time
.
ParseInLocation
(
formatSimple1
,
dateTime
,
time
.
Local
)
stamp
,
err
:=
time
.
ParseInLocation
(
formatSimple1
,
dateTime
,
time
.
Local
)
return
stamp
,
err
exception
.
AssertThrowable
(
err
!=
nil
,
"SYSTEM_ERR.TIME_INVALID"
,
fmt
.
Sprintf
(
"%s格式错误"
,
name
))
return
stamp
}
}
func
AddDate
(
date
time
.
Time
,
d
int
)
time
.
Time
{
func
AddDate
(
date
time
.
Time
,
d
int
)
time
.
Time
{
...
...
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