aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/portable_date.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/portable_date.sh b/scripts/portable_date.sh
new file mode 100755
index 0000000000..84a18eb621
--- /dev/null
+++ b/scripts/portable_date.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+case $(uname) in
+ NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
+ date -r $1 $2
+ ;;
+ *)
+ date -d @$1 $2
+esac
+
+exit $?