3 ms·
To pretty print the Unix timestamp in your ZSH prompt, you can use something like this: function prompt_epoch() { printf -v COMMA_EPOCH "%'d" ${EPOCHSE
by bloopernova 4y ago
To pretty print the Unix timestamp in your ZSH prompt, you can use something like this:
function prompt_epoch() {
printf -v COMMA_EPOCH "%'d" ${EPOCHSECONDS}
p10k segment -f 66 -t ${COMMA_EPOCH}
}
It relies on zmodload zsh/datetime to get EPOCHSECONDS. In the example above I'm using it with the powerlevel10k prompt.