Author: nbd
Date: 2016-02-01 11:33:15 +0100 (Mon, 01 Feb 2016)
New Revision: 48592

Modified:
   trunk/scripts/portable_date.sh
Log:
scripts/portable_date.sh: fix parsing of date strings on non-GNU systems

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/scripts/portable_date.sh
===================================================================
--- trunk/scripts/portable_date.sh      2016-02-01 01:06:56 UTC (rev 48591)
+++ trunk/scripts/portable_date.sh      2016-02-01 10:33:15 UTC (rev 48592)
@@ -2,10 +2,10 @@
 
 case $(uname) in
        NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
-               date -r $1 $2
+               date -j -f "%Y-%m-%d %H:%M:%S %z" "$1" "$2" 2>/dev/null
                ;;
        *)
-               date -d @$1 $2
+               date -d "@$1" "$2"
 esac
 
 exit $?
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to