PluginBench
Skill
Official
Pass
Audit score 90

dotnet-timezone

github/awesome-copilot

Production-safe .NET timezone handling with copy-paste C# code for TimeZoneInfo, NodaTime, and cross-platform scenarios.

What is dotnet-timezone?

Resolves timezone questions for .NET and C# applications, including address/location lookups, UTC conversions, DST handling, and cross-platform Windows/IANA timezone ID compatibility. Use when building timezone-aware features, scheduling across regions, or persisting time data safely.

  • Resolve timezone IDs from addresses, cities, regions, and countries with Windows and IANA mappings
  • Convert between UTC and local time with TimeZoneInfo, TimeZoneConverter, and NodaTime
  • Generate copy-paste-ready C# code patterns for timezone arithmetic and DST-sensitive scheduling
  • Map cross-platform timezone IDs for Windows, Linux, containers, and Azure environments
  • Warn about common pitfalls like platform-specific ID formats, DST transitions, and database storage anti-patterns
  • Handle ambiguous and invalid DST timestamps with proper validation

How to install dotnet-timezone

npx skills add https://github.com/github/awesome-copilot --skill dotnet-timezone
Claude Code
Cursor
Windsurf
Cline

How to use dotnet-timezone

  1. 1.Identify your request type: address lookup, timezone ID lookup, UTC conversion, cross-platform compatibility, scheduling, or API design
  2. 2.For location-based requests, provide the address, city, region, or country name
  3. 3.For code requests, describe the scenario (e.g., recurring jobs, API design, DST handling)
  4. 4.Review the recommended implementation and copy-paste the provided C# snippet into your project
  5. 5.If using third-party libraries like TimeZoneConverter or NodaTime, install via NuGet as indicated

Use cases

Good for
  • Building a scheduling system that handles daylight saving time transitions across multiple regions
  • Converting user-submitted times from different timezones to UTC for database storage and API responses
  • Resolving the correct timezone for a customer address and generating localized time displays
  • Migrating timezone handling from Windows-only TimeZoneInfo to cross-platform TimeZoneConverter
  • Implementing recurring job scheduling that respects DST rules and timezone boundaries
Who it's for
  • C# and .NET developers building timezone-aware applications
  • Backend engineers designing APIs and data persistence for multi-region systems
  • DevOps and cloud engineers deploying .NET services to Azure, Linux, or containerized environments
  • Full-stack developers handling user-facing scheduling, booking, or time-display features

dotnet-timezone FAQ

Should I use TimeZoneInfo, TimeZoneConverter, or NodaTime?

Use TimeZoneInfo for Windows-only code. Use TimeZoneConverter for cross-platform work (Linux, containers, cloud). Use NodaTime for recurring schedules, strict DST rules, or complex timezone arithmetic.

What's the difference between Windows and IANA timezone IDs?

Windows IDs (e.g., 'Eastern Standard Time') work on Windows with TimeZoneInfo.FindSystemTimeZoneById(). IANA IDs (e.g., 'America/New_York') work on Linux, in containers, and with TimeZoneConverter and NodaTime. Always provide both for cross-platform code.

Should I store DateTime.Now or DateTime.UtcNow in the database?

Always store DateTime.UtcNow in the database. Avoid DateTime.Now and DateTimeKind.Unspecified unless deliberate. Convert to local time only when displaying to users.

How do I handle DST transitions that skip or repeat local times?

Use NodaTime or TimeZoneConverter with explicit UTC timestamps. Avoid relying on local time arithmetic during DST transitions. Validate ambiguous times and reject invalid ones.

How do I find the timezone for a city or address?

Provide the city, region, or country name. The skill will look up the IANA and Windows timezone IDs from the timezone index and return a ready-to-use C# snippet.

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: dotnet-timezone description: '.NET timezone handling guidance for C# applications. Use when working with TimeZoneInfo, DateTimeOffset, NodaTime, UTC conversion, daylight saving time, scheduling across timezones, cross-platform Windows/IANA timezone IDs, or when a .NET user needs the timezone for a city, address, region, or country and copy-paste-ready C# code.'

.NET Timezone

Resolve timezone questions for .NET and C# code with production-safe guidance and copy-paste-ready snippets.

Start With The Right Path

Identify the request type first:

  • Address or location lookup
  • Timezone ID lookup
  • UTC/local conversion
  • Cross-platform timezone compatibility
  • Scheduling or DST handling
  • API or persistence design

If the library is unclear, default to TimeZoneConverter for cross-platform work. If the scenario involves recurring schedules or strict DST rules, prefer NodaTime.

Resolve Addresses And Locations

If the user provides an address, city, region, country, or document containing place names:

  1. Extract each location from the input.
  2. Read references/timezone-index.md for common Windows and IANA mappings.
  3. If the exact location is not listed, infer the correct IANA zone from geography, then map it to the Windows ID.
  4. Return both IDs and a ready-to-use C# example.

For each resolved location, provide:

Location: <resolved place>
Windows ID: <windows id>
IANA ID: <iana id>
UTC offset: <standard offset and DST offset when relevant>
DST: <yes/no>

Then include a cross-platform snippet like:

using TimeZoneConverter;

TimeZoneInfo tz = TZConvert.GetTimeZoneInfo("Asia/Colombo");
DateTime local = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tz);

If multiple locations are present, include one block per location and then a combined multi-timezone snippet.

If a location is ambiguous, list the possible timezone matches and ask the user to choose the correct one.

Look Up Timezone IDs

Use references/timezone-index.md for Windows to IANA mappings.

Always provide both formats:

  • Windows ID for TimeZoneInfo.FindSystemTimeZoneById() on Windows
  • IANA ID for Linux, containers, NodaTime, and TimeZoneConverter

Generate Code

Use references/code-patterns.md and pick the smallest pattern that fits:

  • Pattern 1: TimeZoneInfo for Windows-only code
  • Pattern 2: TimeZoneConverter for cross-platform conversion
  • Pattern 3: NodaTime for strict timezone arithmetic and DST-sensitive scheduling
  • Pattern 4: DateTimeOffset for APIs and data transfer
  • Pattern 5: ASP.NET Core persistence and presentation
  • Pattern 6: recurring jobs and schedulers
  • Pattern 7: ambiguous and invalid DST timestamps

Always include package guidance when recommending third-party libraries.

Warn About Common Pitfalls

Mention the relevant warning when applicable:

  • TimeZoneInfo.FindSystemTimeZoneById() is platform-specific for timezone IDs.
  • Avoid storing DateTime.Now in databases; store UTC instead.
  • Treat DateTimeKind.Unspecified as a bug risk unless it is deliberate input.
  • DST transitions can skip or repeat local times.
  • Azure Windows and Azure Linux environments may expect different timezone ID formats.

Response Shape

For address and location requests:

  1. Return the resolved timezone block for each location.
  2. State the recommended implementation in one sentence.
  3. Include a copy-paste-ready C# snippet.

For code and architecture requests:

  1. State the recommended approach in one sentence.
  2. Provide the timezone IDs if relevant.
  3. Include the minimal working code snippet.
  4. Mention the package requirement if needed.
  5. Add one pitfall warning if it matters.

Keep responses concise and code-first.

References

  • references/timezone-index.md: common Windows and IANA timezone mappings
  • references/code-patterns.md: ready-to-use .NET timezone patterns