DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
27.45k stars 1.47k forks source link

Unix timestamps expanded beyond just seconds #1420

Open Ksingh108 opened 1 month ago

Ksingh108 commented 1 month ago

What improvement do you think would an existing feature or tool in DevToys?

The current "Unix Timestamp Converter" tool only works with seconds. I have epoch times in micro, milli, and nano seconds that I would like to convert to date time. Also to generate an epcoh value at those various levels (micro/milli/nano)

Solution/Idea

The converter input can take longer values that can be processed and output timestamps at micro, milli, and nano seconds.

Have dropdown for generation of epoch time now button to choose from micro, milli, and nano seconds to create matching output values

Comments

No response

btiteux commented 1 month ago

Hello, the "Date Converter" tool supports milliseconds. Can you give me a sample of a timestamp that is not working with milliseconds?

We can see how to add this support for the micro and nanoseconds.

My main concern will be on the UI side, which is correctly displaying the fields in compact mode.

Ksingh108 commented 1 month ago

Hi. For milliseconds time 1729695663179 for example when pasting causes the number on input to change to a number that was not what was pasted and year becomes 9999 etc. Screenshot below after pasting, the number changed, and outputs incorrect image

btiteux commented 1 month ago

Oh, I see. You are using the old version of DevToys, aka DevToys v1. We published the preview version of DevToys v2.

The v2 supports milliseconds. image

We can see to support micro and nano.