Plugin skill: GlowSIMS ERP should enforce ServerDate.cs for DateTime conversions

Resolved 💬 2 comments Opened Apr 13, 2026 by Asfand1502 Closed Apr 16, 2026

Context

When working on the GlowSIMS ERP codebase (glowsims-erp), the plugin skills (glowsims-erp:glowsims-mvc-patterns, glowsims-erp:glowsims-db-patterns, etc.) do not currently instruct Claude to use the project's centralized ServerDate.cs utility class for DateTime operations.

Problem

During a library module implementation session, Claude generated 18 inline epoch-to-DateTime conversions using:

new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(ms).ToLocalTime()

And used System.DateTime.Now for audit timestamps (CreatedDate/UpdatedDate).

Both approaches are incorrect for this project because:

  • .ToLocalTime() depends on server locale and breaks on non-PKT servers/Docker containers
  • DateTime.Now returns server time, not Pakistan Standard Time

The project has a centralized ServerDate.cs (GlowSims.Models.ServerDate) with predefined functions:

  • ServerDate.ConvertEpochToPakistanDateTime(long ms) — epoch ms → PKT DateTime
  • ServerDate.ConvertEpochToPakistanDateTime(string ms) — string overload
  • ServerDate.ConvertServerDateIntoLocalDateTime() — current time in PKT
  • ServerDate.ConvertServerDateIntoLocalDate() — current date in PKT

All 18 occurrences had to be retroactively replaced.

Requested Change

Update the GlowSIMS ERP plugin skills (specifically glowsims-mvc-patterns and glowsims-db-patterns) to include guidance:

  1. Never use DateTime.Now or DateTime.UtcNow directly — use ServerDate.ConvertServerDateIntoLocalDateTime()
  2. Never write inline epoch conversion — use ServerDate.ConvertEpochToPakistanDateTime(long ms)
  3. For audit columns (CreatedDate, UpdatedDate) — always accept epoch ms from the client and convert via ServerDate
  4. Add using GlowSims.Models; when using ServerDate functions

This ensures timezone-safe DateTime handling across all modules.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗