Dotnet Timezone
GitHubOfficialFirst committed by pasindudilshan1Distributed by GitHub
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides developers with production-safe guidance for managing timezones in .NET applications. It covers cross-platform compatibility, conversion between Windows and IANA timezone IDs, and best practices for handling daylight saving time and scheduling. The skill includes a reference index for common timezone mappings and specific code patterns for libraries like TimeZoneConverter and NodaTime.
What it does
- Resolves timezone IDs for specific cities, regions, or countries.
- Provides cross-platform C# code snippets for timezone conversion.
- Maps between Windows and IANA timezone identifiers.
- Offers patterns for handling daylight saving time and ambiguous timestamps.
- Recommends appropriate libraries based on project requirements.
- Warns against common pitfalls like using local time in databases.
When to use it
- When you need to convert between UTC and local time in a C# application.
- When building cross-platform .NET apps that must run on both Windows and Linux.
- When implementing recurring jobs or scheduling logic that respects local timezone rules.
- When you need to resolve a location to its corresponding Windows and IANA timezone IDs.
- When dealing with complex timezone arithmetic or DST edge cases.
Advantages
- Reduces errors by promoting UTC-first storage practices.
- Simplifies cross-platform development by bridging Windows and IANA ID differences.
- Provides ready-to-use, copy-pasteable code patterns for common scenarios.
- Helps avoid common pitfalls like hardcoded offsets or incorrect timestamp handling.
Usage examples
- “How do I convert UTC to Tokyo time in a cross-platform .NET app?”
- The agent provides a code snippet using the TimeZoneConverter library, showing how to retrieve the Tokyo timezone and perform the conversion.
- “What is the IANA ID for Sri Lanka and how do I use it in NodaTime?”
- The agent returns the IANA ID (Asia/Colombo) and a NodaTime code example using DateTimeZoneProviders.Tzdb.
- “How should I handle recurring jobs across timezones in ASP.NET Core?”
- The agent suggests using TimeZoneConverter to translate local time to UTC before scheduling and provides an example using RecurringJobOptions.
- “My app is failing on Linux because of Windows timezone IDs. How do I fix this?”
- The agent explains the difference between Windows and IANA IDs and recommends using the TimeZoneConverter library to handle the mapping automatically.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/dotnet-timezone/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip dotnet-timezone.zip -d .agents/skills
Documentation by pasindudilshan1
.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 WindowsIANA 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 codePattern 2:
TimeZoneConverterfor cross-platform conversionPattern 3:
NodaTimefor strict timezone arithmetic and DST-sensitive schedulingPattern 4:
DateTimeOffsetfor APIs and data transferPattern 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
Files
- ATTRIBUTION.mdAdded by AutoGineer877 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md3.8 KiB
- references/code-patterns.md4.5 KiB
- references/timezone-index.md4.3 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
pasindudilshan1
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/dotnet-timezone · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- pasindudilshan1
AutoGineer is not affiliated with or endorsed by pasindudilshan1 or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dotnet-timezone.zip