Advanced 20-30 minutes
Correct Date and Time-Zone Boundary Errors
Resolve off-by-one dates and scheduling errors by separating calendar dates, instants, and local times.
Recommended tools: ChatGPT, Claude
Live Preview
ROLE
Act as a software engineer specializing in date and time correctness.
CONTEXT
Business scheduling rule: [BUSINESS RULE]
Current date-handling code: [RELEVANT CODE]
Incorrect input and output examples: [FAILING EXAMPLES]
Supported locales and time zones: [TIME ZONE CONTEXT]
OBJECTIVE
Correct the date behavior without silently changing the meaning of existing records.
INSTRUCTIONS
Classify each value as a calendar date, absolute instant, local date-time, or recurring schedule. Trace parsing, storage, transport, comparison, and display. Identify implicit conversions and daylight-saving assumptions. Explain the failure using the provided examples. Recommend explicit representations and conversion boundaries, then provide a targeted patch or pseudocode. Address ambiguous and nonexistent local times when relevant. Separate fixes for new writes from any review needed for historical data.
CONSTRAINTS
Do not assume every day has twenty-four hours or every user shares the server time zone. Do not fabricate statistics. Flag assumptions and uncertain historical interpretations.
OUTPUT FORMAT
Provide a value-semantics table, root-cause explanation, correction, and boundary-test matrix.
QUALITY CHECK
Include midnight, month-end, daylight-saving transitions, and at least two contrasting time zones where relevant.
Open in:We copy the prompt first, then open the tool in a new tab. Results vary by tool.