Switch arguments order.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 21 Feb 2017 10:06:40 +0200
changeset 834 31202b672717
parent 833 490674629971
child 835 b2e3e02b9259
Switch arguments order.
.bashrc
--- a/.bashrc	Mon Feb 20 14:20:06 2017 +0200
+++ b/.bashrc	Tue Feb 21 10:06:40 2017 +0200
@@ -213,7 +213,7 @@
 datediff() {
   [[ -n "$1" ]] || { echo first argument is missing; return 1; }
   [[ -n "$2" ]] || { echo second argument is missing; return 1; }
-  local diff=$(( $(date -d "$2" +%s) - $(date -d "$1" +%s) ))
+  local diff=$(( $(date -d "$1" +%s) - $(date -d "$2" +%s) ))
   local sec=$(( diff % 60 ))
   diff=$(( diff / 60 ))
   local min=$(( diff % 60 ))