Timestamp Conversion
Convert Unix timestamps and date strings to a human-readable local date.

Usage
- Select a timestamp or date string in a text editor.
- Open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P).
- Run Timestamp Conversion: Convert Timestamp.
The converted value is appended to the selection instead of replacing it. The
time is displayed in the local time zone. For example, in Asia/Shanghai:
1700000000->2023-11-15 06:13:20
- 10-digit integers are interpreted as Unix timestamps in seconds.
- Other integer values are interpreted as Unix timestamps in milliseconds.
- Date strings accepted by JavaScript's
Date.parse are supported.
- Negative timestamps and surrounding whitespace are supported.
When multiple selections are active, $i is replaced with the one-based
selection number before conversion:
170000000$i
170000000$i
Invalid selections show an error message without preventing valid selections
from being converted.
Development
npm install
npm run compile
npm run lint
npm test
Release notes
1.2.1
- Improved the README demo and usage examples.
1.2.0
- Fixed date-string conversion.
- Added validation and error messages for invalid input.
- Added support for negative timestamps and automated behavior tests.
1.1.0
Added the dateformat dependency.
1.0.0
Initial release of Timestamp Conversion.
| |