UTC时间戳转为时间

时间:2021-03-29 02:41:14
        /// <summary>
        /// 将UTC时间转化DateTime时间
        /// </summary>
        /// <returns></returns>
        private DateTime ChangeUTCToDateTime(double utc)
        {
            DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));

            startTime = startTime.AddSeconds(utc);
            startTime = startTime.AddHours(8);
            return startTime;
        }