ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Timestamp Sort

by Daij-Djan ST4

A Sublime Text 4 plugin to sort log messages based on their timestamps.

Details

Installs

  • Total 2
  • Win 0
  • Mac 2
  • Linux 0
Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Timestamp Sort (Editor Plugin)

A text editor plugin to sort log messages based on their timestamps.
Supports multiple timestamp formats, including Unix time. Works under Sublime 4

Features

  • Sorts log entries by timestamp.
  • Handles multi-line log messages.
  • Preserves non-timestamped lines at the end.
  • Supports a variety of timestamp formats.

Supported Timestamp Formats

  • YYYY-MM-DD HH:mm:ss.SSS (e.g. 2025-06-06 08:36:46.827)
  • YYYY-MM-DD HH:mm:ss (e.g. 2025-06-06 08:36:46)
  • YYYY/MM/DD HH:mm:ss (e.g. 2025/06/06 08:36:46)
  • HH:mm:ss (defaults to 2000-01-01 date)
  • Unix timestamps in:
    • seconds: 1717666606
    • milliseconds: 1717666606827

Manual Installation

  1. Place your plugin .py file in: Packages/User/timestamp_sort.py

To open this folder from Sublime Text:
Preferences > Browse Packages...

  1. Create or update a Command Palette entry in Packages/User/Default.sublime-commands:
[
  {
    "caption": "Sort: By Timestamp",
    "command": "timestamp_sort"
  }
]


3. (Optional) Add a main menu entry in Packages/User/Main.sublime-menu:

## Usage

  Open a file with log entries.

  Use the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and search for:
  Sort: By Timestamp

  Or use the Tools menu if you added a menu item.

## Notes
- processes the currently open file
- Assumes timestamps are at the beginning of log entry: 
**Log entries can have multiple lines but the 1st line of each entry (paragraph) has to start with a timestamp.**
- Lines before any detectable timestamp are moved to the end in their original order.

## License
MIT