DevToys icon indicating copy to clipboard operation
DevToys copied to clipboard

Hope to support timestamp covert with milliseconds.

Open jark006 opened this issue 3 years ago • 4 comments

What's the Problem?

No response

Solution/Idea

Hope to support timestamp(in milliseconds) covert. Just 3 more number. Example: 1653050156 -> 2022-05-20 12:35:56 UTC But 1653050156458 -> invalid

Alternatives

For timestamp in milliseconds. Maybe you can ignore the last three digits during the conversion

Priorities

Capability Priority
This proposal will allow developers to accomplish W Must
This proposal will allow end users to accomplish X Should
This proposal will allow developers to accomplish Y Could
This proposal will allow end users to accomplish Z Won't

DevToys Version

Version 1.0.6.0 | X64 | RELEASE | c032ebb | c032ebb

Comments

No response

jark006 avatar May 20 '22 12:05 jark006

Did a check, seems like this already implemented in latest version

DevToys Version Version 1.0.11.0 | X64 | RELEASE | 2b57a920 | 2b57a920

image

pureiboi avatar May 04 '23 07:05 pureiboi

Did a check, seems like this already implemented in latest version

DevToys Version Version 1.0.11.0 | X64 | RELEASE | 2b57a92 | 2b57a92

image

Try entering 1653050156458 , a millisecond timestamp, that's what I need to convert

jark006 avatar May 04 '23 08:05 jark006

I think the feature was intended for unix time conversion, that is measured by seconds past epoch (wikipedia https://en.wikipedia.org/wiki/Unix_time)

however in coding, unix timestamps can be in seconds, milliseconds, microseconds and nanoseconds. (reference to https://www.epochconverter.com/)

I guess to make this with more sense. i think it's good to be able to

  • auto detect whether it is seconds or milliseconds etc..
  • optionally able to toggle to fix seconds or milliseconds etc..

Does this sound good?

pureiboi avatar May 04 '23 10:05 pureiboi

In modern moding, many unix ticks can output to nanoseconds where values are stored with higher granularity. Maybe consider and support granularity to nanoseconds? e.g. https://man7.org/linux/man-pages/man3/timespec.3type.html https://pkg.go.dev/time#Time.UnixNano

goyzhang avatar Sep 23 '23 16:09 goyzhang