//把UTC时间转换成北京时间 DateTime now = DateTime.Parse(DateTime.UtcNow.ToString(), new CultureInfo("zh-CN"), System.Globalization.DateTimeStyles.AssumeUniversal); //把北京时间转换成UTC时间 DateTime nowUTC = now.ToUniversalTime();
时间: 2024-11-08 12:01:30
//把UTC时间转换成北京时间 DateTime now = DateTime.Parse(DateTime.UtcNow.ToString(), new CultureInfo("zh-CN"), System.Globalization.DateTimeStyles.AssumeUniversal); //把北京时间转换成UTC时间 DateTime nowUTC = now.ToUniversalTime();