84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
private static SimpleDateFormat formatter = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", Locale.ENGLISH); String startTime = formatter.format(new Date());//请求时间
能帮我用c#代码写上面这段Java代码吗?
闭关修行中......
// 查看当前系统支持的所有时区,主要是用 StandardName, // 不过 ToString() 会显示时间差以及城市,可以帮忙人工判断 // foreach (var z in TimeZoneInfo.GetSystemTimeZones()) { // Console.WriteLine($"{z.StandardName} - ${z}"); // } // 获取英国的时区 TimeZoneInfo zone = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"); Console.WriteLine(zone); Console.WriteLine(DateTime.Now.Kind); // Local var gtmTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, zone); Console.WriteLine(gtmTime); var d = new DateTime(2015, 9, 1, 18, 0, 0, DateTimeKind.Utc); Console.WriteLine(d.Kind); // Utc Console.WriteLine(TimeZoneInfo.ConvertTime(d, TimeZoneInfo.Utc, zone));
闭关修行中......