Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

feature request: Unix Timestamp convert #120

Open
AdamJel opened this issue Jan 8, 2023 · 1 comment
Open

feature request: Unix Timestamp convert #120

AdamJel opened this issue Jan 8, 2023 · 1 comment

Comments

@AdamJel
Copy link

AdamJel commented Jan 8, 2023

Hi,

it would be useful to have a converter between ISO time "2022-12-30T16:39:12+00:00" and unix timestamp.

Would you consider it, please?

Great application, btw, thanks for making it :)

@sohalsdr
Copy link

sohalsdr commented Mar 8, 2023

Hey @AdamJel, this issue is a bit old but I hope this is still helpful. Here's a tiny bash script you can use with the "custom tools" feature of the application. Just create a custom tool, then when it opens your editor replace the contents of that file with this script:

#!/usr/bin/env bash

# Read ISO time from STDIN to the variable standard_input
read -r standard_input

# Calls the system's date command to read in the ISO 8601 formatted date and output as seconds from epoch
date -d "${standard_input}" +"%s"

I feel like this tool would be very good to have by default so I may try and make a PR when I have some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants