Skip to content

tmpo export --today and --week use UTC day boundaries instead of local timezone #133

Description

@DylanDevelops

The problem

The export command calculates day boundaries using time.Now().Truncate(24 * time.Hour), which truncates relative to the Unix epoch (UTC midnight). Depending on the user's timezone, an export run late at night might include entries from the previous day and exclude entries from the current day. This contradicts the log command, which correctly builds local midnight using time.Date(..., time.Local).

Release version

0.8.6

Operating system

macOS

Steps to reproduce the behavior

  1. Create a time entry late in the day.
  2. Run tmpo export --today.
  3. Depending on your offset from UTC, the entry may be excluded from the export.

Screenshots

No response

Additional context

Both export and log should ideally use settings.GetDisplayTimezone() rather than time.Local, as users who configure a custom timezone in tmpo config currently get timestamps displayed in that timezone, but day boundaries filtered by their machine's local time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: awaiting triageWaiting for an issue to be addressed.type: bugAn issue that contains a bug report.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions