A simple VS Code extension to help developers work with timestamps by displaying "ghost text" that shows time in a readable format alongside milliseconds. It also provides commands for converting between milliseconds and readable time formats.
- Displays "ghost text" alongside the current timestamp in a human-readable format or the reverse (milliseconds) to help you visualize time while working with timestamps instead of having to write e.g.
1000 * 60 * 60 * 24 * 7. - The ghost text updates in real-time, making it easier to compare and adjust times.
- You can disable the ghost text by adding
// @no-millisecondsto the line.
- Convert milliseconds to readable time: Easily convert any milliseconds value into a human-readable format using a command.
- Convert readable time to milliseconds: Convert human-readable time back to milliseconds with a simple command.
- Displays the time breakdown in the hover tooltip alongside the ghost text, making it easier to understand the time value.
- Option to disable ghost text by clicking
Ignore this line.
- Add
// @no-millisecondsto any line to prevent ghost text from appearing.
Convert Milliseconds to Readable Time: Convert a selected milliseconds value to a readable time format.Convert Readable Time to Milliseconds: Convert a selected time format to milliseconds.
You can run these commands via the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS) or use keyboard shortcuts if configured.
- Open Visual Studio Code.
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+Xon macOS). - Search for
Calculate Milliseconds. - Click
Installon the extension page.
- Once installed, open any file in the editor.
- The extension will display the current timestamp as ghost text in a readable format or milliseconds in the editor.
- Use the commands to convert between milliseconds and readable time when needed.
- Milliseconds to Time: Run the command
Convert Milliseconds to Readable Timeand enter9000000to get2h 30m. - Time to Milliseconds: Run the command
Convert Readable Time to Millisecondsand enter2h 30mto get9000000.
Feel free to fork and contribute to the project! If you find any bugs or have suggestions for new features, please open an issue or submit a pull request.
This extension is licensed under the MIT License.

