Unified date formatting utilities for the OpenMSP platform, providing consistent timestamp display across all components with built-in SSR/hydration safety (React #418) via UTC-pinned date operations. ## Key Components | Function | Description | |---|---| | `formatTicketRelativeTime(iso)` | Ticket-specific relative label: "Just now" / "X min ago" / "X hour(s) ago" / "MM/DD/YYYY" | | `formatTicketFullTimestamp(iso)` | Full tooltip timestamp in `MM/DD/YYYY, H:MM AM/PM` format | | `formatRelativeTime(timestamp)` | General-purpose relative time: "Just now" → "Xm/h/d/w ago" → localized date (source of truth) | | `formatAbsoluteDate(timestamp, options?)` | Localized absolute date via `Intl.DateTimeFormatOptions`, UTC-pinned | | `formatDateTime(timestamp, options?)` | Localized date + time via `Intl.DateTimeFormatOptions`, UTC-pinned | | `getDetailedTimeDifference(timestamp)` | Verbose elapsed time: "X seconds/minutes/hours/days/months/years ago" | | `isToday(timestamp)` | Returns `true` if the timestamp falls on today's local date | | `isWithinMinutes(timestamp, minutes)` | Returns `true` if the timestamp is within the last N minutes | | `createUTCTimestamp()` | Returns current UTC time as an ISO string for database insertion | ## Usage Example ```typescript import { formatRelativeTime, formatAbsoluteDate, formatDateTime, formatTicketRelativeTime, formatTicketFullTimestamp, getDetailedTimeDifference, isToday, isWithinMinutes, createUTCTimestamp, } from './date-utils' // Relative time (general use) formatRelativeTime('2024-01-01T12:00:00Z') // 'Jan 1, 2024' formatRelativeTime(new Date()) // 'Just now' formatRelativeTime('2024-06-15T10:30:00Z') // '3h ago' // Ticket timestamps (UI list / tooltip) formatTicketRelativeTime('2024-06-15T10:30:00Z') // '3 hours ago' or '06/15/2024' formatTicketFullTimestamp('2024-06-15T10:30:00Z') // '06/15/2024, 10:30 AM' // Absolute and datetime formatting formatAbsoluteDate('2024-06-15T10:30:00Z') // 'Jun 15, 2024' formatAbsoluteDate('2024-06-15T10:30:00Z', { month: 'long' }) // 'June 15, 2024' formatDateTime('2024-06-15T10:30:00Z') // 'Jun 15, 2024, 10:30 AM' // Verbose elapsed time getDetailedTimeDifference('2024-06-14T08:00:00Z') // '2 days ago' // Guards and utilities isToday(new Date()) // true isWithinMinutes('2024-06-15T10:29:00Z', 5) // true (if within 5 min) createUTCTimestamp() // '2024-06-15T10:30:00.000Z' ``` > **SSR Safety:** All functions use UTC getters or `timeZone: 'UTC'` to ensure server-rendered output matches client hydration and avoids React hydration mismatch [#418](https://github.com/flamingo-stack/openframe-oss-lib/issues/418).