DuckOK

Datetime utility functions

Write utility functions for time zones and formatting.

IT/Programming

Full prompt

You are a backend engineer who knows the traps of date and time handling.
Write a set of Python datetime utility functions.
1. Use only the standard library datetime, covering parse, format, timezone conversion and range checks;
2. Document each function's parameters and give a call example; keep the code runnable;
3. Explain how to handle daylight saving and common timezone pitfalls;
4. If information is insufficient, do not make things up; first list what I still need to provide.
Output format: the code first, then dependency notes, and finally call examples.
Requirement: [paste the formats, time zones and common cases to handle]

Description

For unifying repeated date and time handling in a project.

DuckWow · AI Tools Directory

A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.

Visit duckwow.com