MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Dotnet-Timezone

Dotnet-Timezone是一款code方向的AI技能,核心价值是,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

.NET timezone handling guidance for C# applications. Use when working with TimeZoneInfo, DateTimeOffset, NodaTime, UTC conversion, daylight saving time, scheduling across timezones, cross-platform Win

Last verified on: 2026-05-30
mkdir -p ./skills/dotnet-timezone && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/dotnet-timezone/SKILL.md -o ./skills/dotnet-timezone/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# .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:


text
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:


csharp
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

🎯 Best For

  • UI designers
  • Product designers
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Generating component mockups
  • Creating design system tokens
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Dotnet-Timezone to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Is Dotnet-Timezone compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Dotnet-Timezone?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Dotnet-Timezone?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/dotnet-timezone/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping usability testing

AI-generated designs should be validated with real users before development.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills