Skip to content

Commit 7dbd6aa

Browse files
committed
fix FullDateFormatUtils bug
1 parent 9bc5f42 commit 7dbd6aa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

springboot-starter/src/main/java/com/codingapi/springboot/framework/utils/FullDateFormatUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33

44
import java.text.SimpleDateFormat;
55
import java.util.Date;
6+
import java.util.TimeZone;
67

78
public class FullDateFormatUtils {
89
private final static SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
910

11+
static {
12+
defaultFormat.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
13+
}
14+
1015
public static String convert(long timestamp){
1116
return convert(new Date(timestamp));
1217
}

springboot-starter/src/test/java/com/codingapi/springboot/framework/utils/TrustAnyHttpClientFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TrustAnyHttpClientFactoryTest {
1313
void createTrustAnyHttpClient() {
1414
ClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(TrustAnyHttpClientFactory.createTrustAnyHttpClient());
1515
RestTemplate restTemplate = new RestTemplate(factory);
16-
String response = restTemplate.getForObject("http://github.com",String.class);
16+
String response = restTemplate.getForObject("https://github.com",String.class);
1717
assertNotNull(response);
1818
}
1919
}

0 commit comments

Comments
 (0)