Showing license expiry in the right time zone
DEV Community
Showing license expiry in the right time zone
A license expires at one instant on the timeline, but "November 30" is a civil date that depends on where you stand. Confuse the two and a customer in Auckland sees "expired" on a key a customer in Los Angeles still shows as valid. This post builds the correct expiry display in .NET: store the expiry as a UTC instant, project it into the viewer''s own time zone with DateTimeOffset and TimeZoneInfo, label the zone, and compute "days remaining" so daylight-saving transitions never make a day 23 or 25 hours long.
0 comments
No comments yet.