@CC.Wang - "GMT+8" is not a time zone. It is an offset from GMT. Those are very different things. Please read the time zone tag wiki, especially the section titled "Time Zone != Offset". If you are actually looking for an offset, there are several ways to get it - but all will require some point in time as the basis. You can use "now" as the basis, but depending on the time zone, that value might be different at some other date and time. In other words, it's a 1-to-N relationship; a time zone has one or more offsets.
@SushiHangover - Per the docs: "Whenever possible, use the TimeZoneInfo class instead of the TimeZone class." You could do TimeZoneInfo.Local.GetUtcOffset(DateTime.Now), or DateTimeOffset.Now.Offset, or a variety of other approaches, but you should not use the TimeZone class, or you might get inaccurate results in some cases.
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)
TimeZoneInfo.Local.GetUtcOffset(DateTime.Now)
, orDateTimeOffset.Now.Offset
, or a variety of other approaches, but you should not use theTimeZone
class, or you might get inaccurate results in some cases.