> ## Documentation Index
> Fetch the complete documentation index at: https://committ.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Time Utilities

> Date formatting, epoch conversion, and timezone helpers.

# Time Utilities

The Time Utilities module (lib/time.ts) provides standardized date and time helper functions used across the application.

***

## Core Functions

| Function                    | Purpose                                                            |
| :-------------------------- | :----------------------------------------------------------------- |
| formatTimeRange(start, end) | Formats an epoch range into "6:00 AM - 8:00 AM" display string     |
| toLocalEpoch(date)          | Converts a Date object to epoch milliseconds in the local timezone |
| fromEpoch(ms)               | Converts epoch milliseconds to a dayjs object                      |
| isToday(epoch)              | Checks if an epoch timestamp falls on the current calendar day     |
| getRelativeDay(epoch)       | Returns "Today", "Tomorrow", or the formatted date string          |

***

## Timezone Safety

All time operations use dayjs with timezone awareness. Epoch timestamps stored in SQLite and Convex are always in UTC. Display formatting always converts to the device's local timezone.
