圣诞快乐
# v1.3 更新列表
1. 【新增】砍价
2. 【新增】拼团
3. 【新增】一号通
4. 【修复】商品sku 编辑时出现商品属性对应错误的问题
5. 【修复】商品推广海报生成二维码可能会出错的问题【小程序调试中】
6. 【修复】微信公众号和小程序头像可能获取不到的问题
7. 【修复】下单时可能会出错的问题
8. 【修复】pc管理端用户访问量
9. 【修复】微信退款
10. 【修复】管理端订单状态可能出现不正确的情况
11. 【修复】WEB管理端-菜单色调,短信API更新,首页用户访问量,系统设置tab是自动选择下一及表单
12. 【修复】系统设置出现更新不正确的问题
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.constants.Constants;
|
||||
import com.exception.CrmebException;
|
||||
import com.utils.vo.dateLimitUtilVo;
|
||||
@@ -121,9 +124,7 @@ public final class DateUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期,指定格式
|
||||
* 描述:<描述函数实现的功能>.
|
||||
*
|
||||
* 获取当前时间戳(秒级)
|
||||
* @return
|
||||
*/
|
||||
public static Long getTime() {
|
||||
@@ -346,6 +347,15 @@ public final class DateUtil {
|
||||
return Integer.parseInt(timestamp);
|
||||
}
|
||||
|
||||
//获取时间戳10位
|
||||
public static int getSecondTimestamp(Long timeMillis){
|
||||
if (null == timeMillis) {
|
||||
return 0;
|
||||
}
|
||||
String timestamp = String.valueOf(timeMillis / 1000);
|
||||
return Integer.parseInt(timestamp);
|
||||
}
|
||||
|
||||
//获取时间戳11位
|
||||
public static int getSecondTimestamp(){
|
||||
Date date = strToDate(nowDateTime(Constants.DATE_FORMAT), Constants.DATE_FORMAT);
|
||||
@@ -581,4 +591,43 @@ public final class DateUtil {
|
||||
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
|
||||
return hour;
|
||||
}
|
||||
|
||||
/**
|
||||
* 13位时间戳转字符串
|
||||
* @param timestamp
|
||||
* @param dateFormat
|
||||
* @return
|
||||
*/
|
||||
public static String timestamp2DateStr(Long timestamp, String dateFormat) {
|
||||
if (ObjectUtil.isNull(timestamp)) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isBlank(dateFormat)) {
|
||||
dateFormat = Constants.DATE_FORMAT;
|
||||
}
|
||||
Date date = new Date(timestamp);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
|
||||
return simpleDateFormat.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转13位时间戳
|
||||
*/
|
||||
public static Long dateStr2Timestamp(String dateStr, String type) {
|
||||
DateTime parse = cn.hutool.core.date.DateUtil.parse(dateStr);
|
||||
if (StrUtil.isNotBlank(type)) {
|
||||
if (type.equals(Constants.DATE_TIME_TYPE_BEGIN)) {
|
||||
parse = cn.hutool.core.date.DateUtil.beginOfDay(parse);
|
||||
}
|
||||
if (type.equals(Constants.DATE_TIME_TYPE_END)) {
|
||||
parse = cn.hutool.core.date.DateUtil.endOfDay(parse);
|
||||
}
|
||||
}
|
||||
return parse.getTime();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(StringUtils.strip("fsfsdf", "f"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user