Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve time and date functions #28

Open
ugol opened this issue Sep 28, 2024 · 1 comment
Open

refactor: improve time and date functions #28

ugol opened this issue Sep 28, 2024 · 1 comment

Comments

@ugol
Copy link
Contributor

ugol commented Sep 28, 2024

  • nowsub and nowadd with durations as parameters instead of ms
  • datesub and dateadd (same but starting from a date)

using different dateformats to decide output

@paoven
Copy link

paoven commented Sep 30, 2024

  • It would be very helpful allowing timestamp generation functions like now_add, now_sub, just_passed to take delta parameter value as a duration, something like {{now_sub '5s'}}
  • Proposing to emit the mentioned timestamp functions output value as an int64/long representing the number of seconds/milliseconds/microseconds from January 1st, 1970 UTC. Desired epoch precision could be taken as an input parameter (defaulting to ms), something like {{just_passed '5s' 'ms'}}
    • this allows end user choosing the desired precision
    • in the case end user needs to format the epoch to a date, it can always do this in the client application. Eventually I propose to consider extending jr functions with a date formatting function which takes in input an epoch and a date format:
      • {{date_format '1727695554' 'RFC1123'}} which would output 'Mon, 30 Sep 2024 13:26:30 CEST'

@ugol ugol changed the title Refactor time and date functions refactor: improve time and date functions Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants