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-timezoneHow to use dotnet-timezone
- 1.Identify your request type: address lookup, timezone ID lookup, UTC conversion, cross-platform compatibility, scheduling, or API design
- 2.For location-based requests, provide the address, city, region, or country name
- 3.For code requests, describe the scenario (e.g., recurring jobs, API design, DST handling)
- 4.Review the recommended implementation and copy-paste the provided C# snippet into your project
- 5.If using third-party libraries like TimeZoneConverter or NodaTime, install via NuGet as indicated
Use cases
- 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
- 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
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.
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.
Always store DateTime.UtcNow in the database. Avoid DateTime.Now and DateTimeKind.Unspecified unless deliberate. Convert to local time only when displaying to users.
Use NodaTime or TimeZoneConverter with explicit UTC timestamps. Avoid relying on local time arithmetic during DST transitions. Validate ambiguous times and reject invalid ones.
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:
- Extract each location from the input.
- Read
references/timezone-index.mdfor common Windows and IANA mappings. - If the exact location is not listed, infer the correct IANA zone from geography, then map it to the Windows ID.
- 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, andTimeZoneConverter
Generate Code
Use references/code-patterns.md and pick the smallest pattern that fits:
- Pattern 1:
TimeZoneInfofor Windows-only code - Pattern 2:
TimeZoneConverterfor cross-platform conversion - Pattern 3:
NodaTimefor strict timezone arithmetic and DST-sensitive scheduling - Pattern 4:
DateTimeOffsetfor 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.Nowin databases; store UTC instead. - Treat
DateTimeKind.Unspecifiedas 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:
- Return the resolved timezone block for each location.
- State the recommended implementation in one sentence.
- Include a copy-paste-ready C# snippet.
For code and architecture requests:
- State the recommended approach in one sentence.
- Provide the timezone IDs if relevant.
- Include the minimal working code snippet.
- Mention the package requirement if needed.
- Add one pitfall warning if it matters.
Keep responses concise and code-first.
References
references/timezone-index.md: common Windows and IANA timezone mappingsreferences/code-patterns.md: ready-to-use .NET timezone patterns
Related skills
More from github/awesome-copilot and the wider catalog.

dotnet-upgrade
Ready-to-use prompts for analyzing and executing comprehensive .NET framework upgrades across multi-project solutions.

doublecheck
Three-layer verification pipeline for AI output with source checking and hallucination detection.

draw-io-diagram-generator
Generate and edit draw.io diagram files with correct mxGraph XML structure, ready to open in VS Code.

editorconfig
Generates best-practice .editorconfig files tailored to your project structure and preferences.

ef-core
Best practices guidance for Entity Framework Core design, querying, and performance.

email-drafter
Draft and review professional emails that match your personal writing style. Analyzes your sent emails for tone, greeting, structure, and sign-off patterns via WorkIQ, then generates context-aware drafts for any recipient. USE FOR: draft email, write email, compose email, reply email, follow-up email, analyze email tone, email style.