You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
date -d 2021-10-08T09:15:15Z +%s
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
man date says the following (unix date):
-d dst Set the kernel's value for daylight saving time. If dst is non-zero, future calls to gettimeofday(2) will return a non-zero for tz_dsttime.
I did not find an appropriat option for this for mac's date.
However, macOS has gdate if coreutils are installed (brew install coreutils), and this works like linux's date.
So the fix may be to use gdate on macOS.
set -l now (gdate --utc +%s)
set -l expiry (gdate -d "$AWS_SESSION_EXPIRATION" +%s)
The best solution would not require installing anything extra.
Environment: macOS Big Sur 11.6
Tl;dr: macOS has Unix
date
, bobthefish assumes Linuxdate
.There 2 problems:
theme-bobthefish/functions/fish_prompt.fish
Line 666 in 626bd39
theme-bobthefish/functions/fish_prompt.fish
Line 667 in 626bd39
Enabling the
theme_display_aws_vault_profile
results in:This is because
date
on macOS (unix) behaves differently from Linux:Potential solution:
I assume the
-u
flag works on a regular linux install. It also works on macOS:theme-bobthefish/functions/fish_prompt.fish
Line 667 in 626bd39
Second problem:
date
does not like the-d
flag.man date
says the following (unixdate
):I did not find an appropriat option for this for mac's
date
.However, macOS has
gdate
ifcoreutils
are installed (brew install coreutils
), and this works like linux's date.So the fix may be to use
gdate
on macOS.The best solution would not require installing anything extra.
Relevant on this topic: https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/
The text was updated successfully, but these errors were encountered: