aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-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 $?