- Removed µs and ns values
- Uses
pytz
package to convert local datetime to epoch correctly (timestamp is hardcoded to Asia/Singapore)- In Singapore, the original repo's timestamp is off by 30min (eg. when typing 2022-01-01 00:00:00, it returns 1640968200 for the local timestamp instead of 1640966400). This is because Singapore's timezone changed from GMT+07:30 to GMT+08:00 in 1982 (source), so the
(dt - datetime.datetime.fromtimestamp(0)).total_seconds()
computation is off by 30min.
- In Singapore, the original repo's timestamp is off by 30min (eg. when typing 2022-01-01 00:00:00, it returns 1640968200 for the local timestamp instead of 1640966400). This is because Singapore's timezone changed from GMT+07:30 to GMT+08:00 in 1982 (source), so the
Makes it easy to work with epoch timestamps!
You can easily type an epoch timestamp with any precision and convert it into a human readable string:
Select the option you want, press enter, and the value is copied into your clipboard:
If you have an epoch timestamp in your clipboard, no need to type or paste it. The workflow will recognize it for you:
You can easily type a human-readable time and convert it into an epoch timestamp with any precision:
Select the option you want, press enter, and the value is copied into your clipboard:
If you have a human-readable time in your clipboard, no need to type or paste it. The workflow will recognize it for you:
You can download the workflow file from GitHub, then double-click to install. The workflow is also released on Packal.
ts <timestamp>
will guess the precision and display as human readable, both Local and GMTts <YYYY-mm-dd>
will give epoch timestamps on that date, at midnightts <YYYY-mm-dd> <HH:MM:SS>
will give epoch timestamps on that date, at that time (both space and T are supported as separator, seconds are optional)ts <HH:MM:SS>
will give epoch timestamps for today, at that time (seconds are optional)ts
will display the current time as a UNIX epoch timestamp with different precisions, as well as attempt converting what is in your clipboard