MCPcopy Create free account
hub / github.com/OreosLab/bili / utcTime

Method utcTime

src/main/java/top/misec/utils/HelpUtil.java:68–84  ·  view source on GitHub ↗
(String utcTime)

Source from the content-addressed store, hash-verified

66 }
67
68 public static String utcTime(String utcTime){
69 SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
70 //设置时区UTC
71 df.setTimeZone(TimeZone.getTimeZone("UTC"));
72 //格式化,转当地时区时间
73 Date after = null;
74 try {
75 after = df.parse(utcTime);
76 } catch (ParseException e) {
77 e.printStackTrace();
78 }
79 df.applyPattern("yyyy-MM-dd HH:mm:ss");
80 //默认时区
81 df.setTimeZone(TimeZone.getDefault());
82 return df.format(after);
83
84 }
85}

Callers 1

printVersionInfoMethod · 0.95

Calls 2

parseMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected