Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 MVC4 项目中工作。在这个项目中,我需要将 UTC 时间转换为从服务器到巴西时区的时间。
如何在 noda 时间库中将 UTC 时间转换为巴西时间。
从根本上说,如果你能得到一个值作为Instant开始,它很简单:
Instant
var instant = ...; // However you're receiving that var zone = DateTimeZoneProviders.Tzdb["America/Sao_Paulo"]; var inBrazil = instant.InZone(zone);