tchar / ulauncher-albert-calculate-anything

A ULauncher/Albert extension that supports currency, units and date time conversion, as well as a calculator that supports complex numbers and functions.
MIT License
103 stars 13 forks source link

[feature] Converstion of time to time unit like ms #32

Open guillaumevauvert-datadome opened 2 years ago

guillaumevauvert-datadome commented 2 years ago

Is your feature request related to a problem?

I would like to convert time to any unit (ms) for instance.

Describe the solution you'd like

time + 1 hour to ms

Describe alternatives you've considered

None with this tool.

Additional context

Not needed.

tchar commented 2 years ago

Hello @guillaumevauvert-datadome,

I am trying to understand what is the feature request.

So let's assume that time is November 25, 2021 00:00 then time + 1 hour will give you November 25, 2021 01:00 right? How do you want to convert this to miliseconds?

Is this a question to convert 1 hour to miliseconds or literaly convert November 25, 2021 01:00 to milliseconds. And if so what would that value be?

Cheers

guillaumevauvert-datadome commented 2 years ago

Hello @tchar , As a software engineer, we often need to convert current date-time to number of millis since 1-1-1970. https://currentmillis.com/ provides some explanations around that. Regards

tchar commented 2 years ago

Ah I see so you need the unix timestamp in whatever units. Let me think if this is easy to implement.

The reason is because the time command does not use the converter (which uses pint) so it has to be implemented using text parsing or by calling the converted from within the Time Handler.

An easy solution could be to parse the query and if it is such a conversion.

Generally these days I don't have much time, but I welcome anyone who wants to help implementing this.

github-actions[bot] commented 2 years ago

Issue has been marked as stale due to no activity