|
@@ -134,10 +134,11 @@ public class GeoIpUtil {
|
|
|
public Date getLocalhostTime(String ip, Date date) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.DATE_TIME_FORMAT);
|
|
|
String timeZone = getTimeZone(ip);
|
|
|
- if (StringUtils.isEmpty(timeZone)) {
|
|
|
- timeZone = "Asia/Shanghai";
|
|
|
- }
|
|
|
- sdf.setTimeZone(TimeZone.getTimeZone(timeZone));
|
|
|
+ sdf.setTimeZone(
|
|
|
+ StringUtils.isNotEmpty(timeZone)
|
|
|
+ ? TimeZone.getTimeZone(timeZone)
|
|
|
+ : TimeZone.getTimeZone(DateUtil.DEFAULT_ZONE_ID));
|
|
|
+
|
|
|
String dateStr = sdf.format(date);
|
|
|
Date res = new Date();
|
|
|
try {
|