Commit 0167d5e7 authored by 张永's avatar 张永

1

parent 1a22fe0d
......@@ -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提供的 转换方式 简--转繁体
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment