Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
archive/scripts/portable_date.sh
Jo-Philipp Wich 75f0cec823 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

12 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 $?