Authored by lijing

登录按钮

... ... @@ -11,6 +11,10 @@ public final class DateUtils {
public final static String DEFAULT_FOMARTPATTER="yyyy-MM-dd HH:mm:ss";
public final static String DAY_FOMARTPATTER="yyyy-MM-dd";
public final static String ACTIVITY_DAY_FOMARTPATTER="yyyy/MM/dd HH:mm";
/**
... ... @@ -146,4 +150,15 @@ public final class DateUtils {
public static void main(String[] args) {
System.out.println(getTodayZero());
}
/**
* 将数据库中的UNIX_Time(该时间是距离1970年的秒数,在转换过程中先要换算成毫秒)转换成UTC时间
* @param time
* @return
*/
public static String getActivityDateString(int time)
{
SimpleDateFormat sdf=new SimpleDateFormat(ACTIVITY_DAY_FOMARTPATTER);
return sdf.format(new Date((long)time*1000));
}
}
... ...
... ... @@ -178,7 +178,7 @@ public class BrandActivityServiceImpl implements IBrandActivityService {
}
List<ActNewBrandResult> results = actNewBrandResultMapper.selectListByUid(uid);
for (ActNewBrandResult result : results) {
result.setCreateTimeStr(result.getCreateTime() == null || result.getCreateTime() == 0 ? "" : DateUtils.getDateString(result.getCreateTime()));
result.setCreateTimeStr(result.getCreateTime() == null || result.getCreateTime() == 0 ? "" : DateUtils.getActivityDateString(result.getCreateTime()));
}
apiRespons = new ApiResponse(200, "用户抽奖记录");
apiRespons.setData(results);
... ...