openwrtv4/scripts/portable_date.sh
Jo-Philipp Wich 78e5e56201 scripts: fix GNU data invocation
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 48594
2016-02-01 10:43:27 +00:00

11 lines
171 B
Bash
Executable file

#!/bin/sh
case $(uname) in
NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
date -j -f "%Y-%m-%d %H:%M:%S %z" "$1" "$2" 2>/dev/null
;;
*)
date -d "$1" "$2"
esac
exit $?