Skip to content

feat: tmpo export --utc flag added to and local timezone is now default timestamp format#86

Merged
DylanDevelops merged 3 commits intomainfrom
ravel/utc-timezone-export-update
Mar 7, 2026
Merged

feat: tmpo export --utc flag added to and local timezone is now default timestamp format#86
DylanDevelops merged 3 commits intomainfrom
ravel/utc-timezone-export-update

Conversation

@DylanDevelops
Copy link
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Description

This pull request adds support for exporting timestamps in UTC as an option for both CSV and JSON export formats. It introduces a new --utc flag to the export command, updates the export logic to handle the new flag, and ensures that timestamps are formatted correctly based on the user's choice. The changes also include improvements to time formatting utility functions and update related tests.

Export functionality enhancements:

  • Added a --utc flag to the export command (cmd/history/export.go), allowing users to choose whether timestamps in exported files are in UTC or their local timezone. [1] [2]
  • Updated the CSV and JSON export functions (ToCSV and ToJson in internal/export/csv.go and internal/export/json.go) to accept an inUtc parameter and format timestamps accordingly. Helper functions were added to handle timestamp formatting for both formats. [1] [2] [3] [4] [5] [6] [7]
  • Modified the export command logic to pass the exportUtc flag to the export functions, ensuring the correct timezone is used during export.

Time formatting improvements:

  • Refactored the toDisplayTime function in internal/settings/global_config.go to be exported as ToDisplayTime, and updated all usages accordingly for consistency and clarity. [1] [2] [3] [4] [5]

Testing updates:

  • Updated tests for CSV and JSON export to include the new inUtc parameter, ensuring coverage for both UTC and local timezone exports. [1] [2] [3] [4] [5] [6] [7] [8]

@DylanDevelops DylanDevelops merged commit f68a9b1 into main Mar 7, 2026
6 checks passed
@DylanDevelops DylanDevelops deleted the ravel/utc-timezone-export-update branch March 7, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant