Closed dead10ck closed 5 years ago
@dead10ck If you direct your attention to the chrono format string used to format the time, you will see:
However, if I understand correctly, this isn't what I think you want, is it?
I believe those are just for printing the time zone of a timestamp, which incidentally is always in the local time zone. The feature I am requesting is to choose the time zone of the timestamp shown in the prompt, instead of always showing the local time.
So for example, if you are in the PST time zone, right now with just
[time]
disabled = false
you would see:
at 12:36:17 ❯
but you could have a timezone
option, so that e.g. you might have a config like:
[time]
disabled = false
timezone = "UTC"
and see:
at 19:36:17 ❯
Thanks for clarifying @dead10ck! I will start work on this!
@dead10ck, I've got a proof-of-concept going on my machine and I just want to double check that what I've got matches what you're asking for.
In this screenshot, you can see the result of updating my config file and then echoing the value I just saved in the config to render a new prompt with the new config being respected (Screenshot taken at roughly 12:25 UTC):
Currently I have a config variable, utc_time_offset
, that defaults to "local"
to skip all tz logic or instead takes a string like "+3"
, "-6"
, etc and uses that to display the current time in that offset instead of your local timezone.
If this seems right then I'll open a PR after adding some better config input validation.
After that, I'd like to try to get actual timezone mapping so you could say timezone = "America_NewYork"
or some other UTC timezone name instead of using offset numbers but from what I've seen of the chrono-tz
crate, that may be easier said than done.
@keawade This is how I envisioned it working. Looks great to me! 👍
Awesome! Specifying an offset definitely gets the job done.
Feature Request
The
time
module currently only shows the local system's time. It would be nice if you could choose a time zone, e.g. so you could always show the timestamp in UTC.