@@ -8,6 +8,7 @@
Loading
8 8
package com.rebuild.api;
9 9
10 10
import cn.devezhao.commons.CalendarUtils;
11 +
import cn.devezhao.commons.DateFormatUtils;
11 12
import com.alibaba.fastjson.JSON;
12 13
import com.rebuild.utils.CommonsUtils;
13 14
import com.rebuild.utils.JSONUtils;
@@ -24,7 +25,7 @@
Loading
24 25
	public JSON execute(ApiContext context) {
25 26
		JSON data = JSONUtils.toJSONObject(
26 27
				new String[] { "time" },
27 -
				new Object[] { CommonsUtils.formatUTCWithZone(CalendarUtils.now()) });
28 +
				new Object[] { CommonsUtils.formatClientDate(CalendarUtils.now()) });
28 29
		return formatSuccess(data);
29 30
	}
30 31
}

@@ -11,6 +11,7 @@
Loading
11 11
import org.apache.commons.lang.StringEscapeUtils;
12 12
import org.apache.commons.lang.StringUtils;
13 13
14 +
import java.text.SimpleDateFormat;
14 15
import java.util.*;
15 16
import java.util.regex.Matcher;
16 17
import java.util.regex.Pattern;
@@ -119,14 +120,12 @@
Loading
119 120
	}
120 121
121 122
	/**
123 +
	 * 客户端所需的日期时间格式(带时区偏移)
122 124
	 * @param date
123 125
	 * @return
124 126
	 */
125 -
	public static String formatUTCWithZone(Date date) {
127 +
	public static String formatClientDate(Date date) {
126 128
		if (date == null) return null;
127 -
		String datetime = CalendarUtils.getUTCDateTimeFormat().format(date);
128 -
		int offset = CalendarUtils.getInstance().get(Calendar.ZONE_OFFSET);
129 -
		offset = offset / 1000 / 60 / 60;  // in hours
130 -
		return datetime + " UTC" + (offset >= 0 ? "+" : "") + offset;
129 +
		return CalendarUtils.getUTCWithZoneDateTimeFormat().format(date);
131 130
	}
132 131
}
Files Coverage
src/main/java/com/rebuild 57.89%
Project Totals (248 files) 57.89%
623.1
TRAVIS_OS_NAME=linux
oraclejdk8=
1
coverage:
2
  range: "40...90"
3
  round: down
4
  precision: 2
5
  
6
  status:
7
    project: yes
8
    patch: no
9
    changes: no
10

11
ignore:
12
  - ".github/.*"
13
  - ".vscode/.*"
14
  - ".setup/.*"
15
  - ".production/.*"
16
  - "src/test/.*"
17
  - "src/main/webapp/.*"
18
  - "src/main/java/com/rebuild/web/.*"
19
  - ".*/.*Exception.java"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading