Plugin skill: GlowSIMS ERP should enforce ServerDate.cs for DateTime conversions
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 containersDateTime.Nowreturns 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 DateTimeServerDate.ConvertEpochToPakistanDateTime(string ms)— string overloadServerDate.ConvertServerDateIntoLocalDateTime()— current time in PKTServerDate.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:
- Never use
DateTime.NoworDateTime.UtcNowdirectly — useServerDate.ConvertServerDateIntoLocalDateTime() - Never write inline epoch conversion — use
ServerDate.ConvertEpochToPakistanDateTime(long ms) - For audit columns (CreatedDate, UpdatedDate) — always accept epoch ms from the client and convert via
ServerDate - Add
using GlowSims.Models;when using ServerDate functions
This ensures timezone-safe DateTime handling across all modules.
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗