summaryrefslogtreecommitdiff
path: root/functions/dateiso.fish
diff options
context:
space:
mode:
Diffstat (limited to 'functions/dateiso.fish')
-rw-r--r--functions/dateiso.fish20
1 files changed, 18 insertions, 2 deletions
diff --git a/functions/dateiso.fish b/functions/dateiso.fish
index 304d753..3d15458 100644
--- a/functions/dateiso.fish
+++ b/functions/dateiso.fish
@@ -1,2 +1,18 @@
-alias 'dateiso'='date --iso-8601=seconds'
-# Can also be taped `date -Is`
+function dateiso --wraps='date' --description 'Utils around date'
+ switch $argv[1]
+ case no-tz
+ date +"%Y-%m-%dT%H:%M:%S" -u
+ case no-tz-local
+ date +"%Y-%m-%dT%H:%M:%S"
+ case timestamp
+ date +"%Y-%m-%dT%H:%M:%S" -d "@$argv[2]"
+ case email
+ #
+ date --rfc-email
+ case help
+ echo -e "Options: \nno-tz => Without timezone \nno-tz-local => without timezone but local \ntimestamp => Convert a timestamp to ISO \nemail => date format email ! Not ISO 8601 !"
+ case '*'
+ date --iso-8601=seconds
+ # Can also be taped `date -Is`
+ end
+end