mirror of
https://github.com/notwa/rc
synced 2024-05-20 02:43:23 -07:00
use UTC for now
i don't like this, but it's my best option to make things mostly monotonic.
This commit is contained in:
parent
e4eb191e15
commit
4889b793af
|
@ -342,11 +342,11 @@ will take a date or a file as an argument too.
|
|||
|
||||
```
|
||||
$ now
|
||||
2016-06-27_19551873
|
||||
$ now ./now
|
||||
2016-03-12_25288645
|
||||
2019-05-27_35083906
|
||||
$ now ~/sh/monitor
|
||||
2017-03-14_82387259
|
||||
$ now '@1234567890'
|
||||
2009-02-13_55890000
|
||||
2009-02-13_84690000
|
||||
```
|
||||
|
||||
### [pacbm](/sh/pacbm)
|
||||
|
|
6
sh/now
6
sh/now
|
@ -4,11 +4,11 @@ now() {
|
|||
local dt=
|
||||
local fmt='+%F_%T_%N'
|
||||
if [ -z "$1" ]; then
|
||||
dt="$(date "$fmt")"
|
||||
dt="$(date -u "$fmt")"
|
||||
elif [ -e "$1" ]; then
|
||||
dt="$(date -r "$1" "$fmt")"
|
||||
dt="$(date -u -r "$1" "$fmt")"
|
||||
else
|
||||
dt="$(date -d "$1" "$fmt")"
|
||||
dt="$(date -u -d "$1" "$fmt")"
|
||||
fi
|
||||
|
||||
local F= T= N=
|
||||
|
|
Loading…
Reference in New Issue
Block a user