简体   繁体   English

NET 4.6.2中的萨摩亚标准时间(SST)

[英]Samoa Standard Time (SST) in .NET 4.6.2

From https://www.timeanddate.com/time/zones/sst , the time zone is UTC -11. https://www.timeanddate.com/time/zones/sst ,时区为UTC -11。 However, when I get timezone info from .NET. 但是,当我从.NET获取时区信息时。 It is the UTC +13. 它是UTC +13。

    var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Samoa Standard Time");

timeZoneInfo is UTC +13. timeZoneInfo是UTC +13。

How can I get the correct time zone info of Samoa Standard Time (SST) in .Net 如何在.Net中获取萨摩亚标准时间(SST)的正确时区信息

Samoa (officially The Independent State of Samoa ) and American Samoa are in two different time zones, on opposite sides of the international date line. 萨摩亚(正式为萨摩亚独立国和美属萨摩亚位于两个不同的时区,位于国际日期线的相对两侧。

萨摩亚群岛地图 Image source: Wikimedia Commons 图片来源:Wikimedia Commons

As always: 一如既往:

  • Use Windows identifiers with .NET Framework and .NET Core when running on Windows. 在Windows上运行时,请将Windows标识符与.NET Framework和.NET Core一起使用。
  • Use IANA identifiers with .NET Core when running on Linux. 在Linux上运行时,请将IANA标识符与.NET Core配合使用。
  • Use the TimeZoneConverter library to use either form of identifier on either platform. 使用TimeZoneConverter库可以在任何平台上使用任何形式的标识符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用.Net Framework 4.6.2在PC上运行.Net Standard 2.0应用程序 - Running a .Net Standard 2.0 Application on a PC with .Net Framework 4.6.2 在.net 4.6.2中使用.net标准2.0库找不到System.Runtime 4.1.0.0 - System.Runtime 4.1.0.0 cannot be found using .net standard 2.0 lib in .net 4.6.2 .Net 4.6.2项目中的.Net标准库:找不到System.Runtime程序集 - .Net Standard Library in .Net 4.6.2 project: System.Runtime assembly not found 在面向.NET 4.6.2的项目中,如何实现.NET Standard 1.5程序集中定义的接口? - In a project targeting .NET 4.6.2, how to implement an interface defined in a .NET Standard 1.5 assembly? 无法将.NET Framework 4.6.2 Web应用程序引用添加到.NET Standard任何版本 - Can not add .NET framework 4.6.2 web app reference to .NET Standard any version 在.net 4.6.2中使用.net标准1.5 lib错过了System.Runtime 4.1.0.0 - Using .net standard 1.5 lib in .net 4.6.2 misses System.Runtime 4.1.0.0 无法加载文件或程序集System.Xml.XPath - .Net 4.6.2引用.Net Standard 1.3 - Impossible to load file or assembly System.Xml.XPath - .Net 4.6.2 referencing .Net Standard 1.3 在 4.6.2 框架中部署 .NET 标准程序集(Microsoft.AspNetCore.SignalR.Client) - Deployment of .NET Standard assembly (Microsoft.AspNetCore.SignalR.Client) in 4.6.2 Framework TLS 1.2 .net 4.6.2项目 - TLS 1.2 .net 4.6.2 project 在.net中获取亚利桑那州标准时间 - Getting the Arizona Standard Time in .net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM