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

[REQ] Datetime variables with custom format #33

Open
ItsDrike opened this issue Feb 21, 2024 · 3 comments
Open

[REQ] Datetime variables with custom format #33

ItsDrike opened this issue Feb 21, 2024 · 3 comments

Comments

@ItsDrike
Copy link

I would love to see an option to customize the format of the $TIME (like for including seconds), and a way to also show the current date, where a customizable format is pretty much necessary as there's different standards for that in different countries.

One way to handle this would be to just add a $DATE variable, and to take the format options for both as options in the config.
Another would be to create a more complex system which would allow specifying the format in the variable, like say $DATETIME[%HH:%MM:%SS]. This option would be better in case someone wanted to show the time multiple times with different formats, but it'd probably be much more complex to actually implement.

@ItsDrike ItsDrike changed the title Datetime variables with custom format [REQ] Datetime variables with custom format Feb 21, 2024
@ItsDrike
Copy link
Author

This could probably also be solved through #29, if it gets addressed, using the date command.

@ItsDrike
Copy link
Author

Not sure if this is still relevant since we now have commands, and can just do text = cmd[update:200] date +'%H:%M:%S' . It'd still be a bit nicer and bit easier to use maybe, but not sure it'd be worth the hassle to implement. Feel free to close.

The only annoyance with using cmds to show time is you can't use 1s update intervals, since the interval doesn't start at a "whole" second, so it could sometimes skip by 2 seconds, which looks bad.

@bvr-yr
Copy link
Contributor

bvr-yr commented Mar 11, 2024

btw for those who on arch, u can use:

enable strftime; strftime '%T' $EPOCHSECONDS

instead of date. spawning not-so-light date every second or even 0.5 very inefficient

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