sql-date-time
/sql-date-time
Pomaga przechowywać, porównywać i grupować znaczniki czasu z jawnymi strefami czasowymi, by raporty nie przesuwały się o dzień, a zakresy nie pomijały wierszy.
- Autor
- Amey-Thakur ↗
- Repozytorium
- AI-SKILLS ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.09.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga przechowywać, porównywać i grupować znaczniki czasu z jawnymi strefami czasowymi, by raporty nie przesuwały się o dzień, a zakresy nie pomijały wierszy.
Oryginalny opis (EN)
Store, compare, and bucket timestamps with explicit time zones so reports do not drift by a day and ranges do not miss rows. Use when filtering by date, grouping by period, or storing an event time.
Jak działa
- Method
- Boundaries
Podgląd SKILL.md
--- name: sql-date-time description: Store, compare, and bucket timestamps with explicit time zones so reports do not drift by a day and ranges do not miss rows. Use when filtering by date, grouping by period, or storing an event time. --- # SQL date and time Time bugs are quiet: a report is off by a day for some users, a range misses the last hour, a daily job double counts around a clock change. Nearly all of them come from an implicit time zone or a boundary written with BETWEEN. ## Method 1. **Store instants in UTC with a time zone aware type.** A naive timestamp is ambiguous the moment two regions use it, and the ambiguity is unrecoverable later. 2. **Convert for display and grouping only.** A daily report means days in someone's local zone, so convert at the point of bucketing and record which zone was used. 3. **Write half-open ranges.** Greater than or equal to the start and strictly less than the end. BETWEEN on timestamps either misses the final fraction of a second or double counts a boundary row. 4. **Beware date arithmetic across clock changes.** Adding a day is not always adding twenty-four hours where daylight saving applies, and the two operations are different functions. 5. **Keep the filter column bare.** Wrapping the column in a function usually prevents index use, so transform the bounds instead of the column (see sql-optimization). 6. **Separate event time from ingestion time.** When something happened and when you recorded it are different questions, and analytics eventually needs both (see batch-vs-streaming). ## Boundaries - Time zone rules change by legislation, so correctness depends on an up-to-date zone database rather than arithmetic. - Date-only values are not instants; treating a birth date as a timestamp introduces a zone question that should not exist. - Precision differs between engines and can silently truncate on insert.
Wersje
W bazie nie ma innych skilli o nazwie sql-date-time.
Migawka bazy z 13.11.2026 · wersja paczki b3e13192217c (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 95storing-data
Pokazuje, jak przechowywać dane aplikacji w SQL: dodawać modele danych oraz czytać i zapisywać rekordy. - 100storing-data
Opisuje, jak przechowywać dane aplikacji w SQL, przy dodawaniu modeli danych i odczycie oraz zapisie. - 90mariadb-date-time-functions
Opisuje funkcje dat i czasu MariaDB: arytmetykę, różnice, formatowanie i czas Unix do zapytań SQL.