azure - 与本地日期时间相比,Windows Azure DateTime 现已缩短 1 天

标签 azure

所以过去 4 个小时我一直在试图解决这个问题。 Windows Azure 上的 DateTime.Now 是 1/10/2013,而本地时间是 1/09/2013。我已经尝试了书中的所有内容来使其对齐,调用 DateTime.Now.ToLocalTime(),执行 UTC 但我仍然无法解决问题。

最佳答案

 private DateTime ConvertToCentral()
        {
            DateTime timeUtc = DateTime.UtcNow;
            TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
                 DateTime cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone);
            return cstTime;
        }

关于azure - 与本地日期时间相比,Windows Azure DateTime 现已缩短 1 天,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14250669/

相关文章:

azure - 自定义存储轮询与消耗计划 Azure Functions 相关吗?

azure - System.Security.Principal.WindowsIdentity (User.Identity) 无法填充 Azure AD 发送的声明

c# - 发布到 Azure 后 Global.asax 中出现解析错误

c# - Azure 模拟器在启动 Web 角色后立即关闭。

angular - 类型 'MsalService' 上不存在属性

azure - 如何在 Azure Kubernetes 服务上模拟可用区中断?

azure - 管道: cannot publish a file from artifacts directory

sql-server - Azure BLOB 存储或 SQL SERVER 保存和获取文件的更好更快的方法是什么?

azure - 服务主体或 azure 应用程序管理员是否可以同意外部 Multi-Tenancy 应用程序注册?

azure - Azure VM 定价是否包括 VHD 中的存储?