Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
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
曲欣亮
common
Commits
0167d5e7
Commit
0167d5e7
authored
Mar 13, 2024
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1a22fe0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
StringUtil.java
src/main/java/com/egolm/common/StringUtil.java
+32
-5
No files found.
src/main/java/com/egolm/common/StringUtil.java
View file @
0167d5e7
...
...
@@ -1230,13 +1230,40 @@ public class StringUtil {
return
ICU4JConverter
(
znStr
);
}
/**
* 验证13位时间戳有 效期
* <p>Title: </p>
* <p>Description: </p>
* @param minute 有效期时间
* @return
*/
public
static
boolean
checkTimeStamp_13
(
int
minute
,
String
timestamp
)
{
try
{
//获取当前时间的时间戳
long
currentTime
=
System
.
currentTimeMillis
();
//计算时间戳范围
long
timeRange
=
minute
*
60
*
1000
;
//毫秒数
long
startRange
=
currentTime
-
timeRange
;
long
timestampToCheck
=
Long
.
valueOf
(
timestamp
);
//校验
if
(
timestampToCheck
>=
startRange
&&
timestampToCheck
<=
currentTime
)
{
//在有效时间内
return
true
;
}
else
{
//不在有效时间内
return
false
;
}
}
catch
(
Exception
e
)
{
return
false
;
}
}
public
static
void
main
(
String
[]
args
)
{
String
original
=
"采购订单收货,支持无订单快捷收货,收货后增加商铺库存。应用业务参数::ShowCheckMsg(制单时提醒是否审核)"
;
String
result
=
ZhConverterUtil
.
toTraditional
(
original
);
System
.
out
.
println
(
"opecc : "
+
result
);
String
result1
=
ICU4JConverter
(
original
);
System
.
out
.
println
(
"icu4j : "
+
result1
);
System
.
out
.
println
(
checkTimeStamp_13
(
5
,
"1710299049919"
));
}
//ibm提供的 转换方式 简--转繁体
...
...
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