mirror of
https://github.com/openwrt/openwrt.git
synced 2026-07-23 07:31:55 +04:00
add scripts/portable_date: wrapper around date for bsd/linux
date -r $unix_timestamp on bsd is equal to date -d @$unix_timestamp on linux. To support reproducible builds and not loosing every timestamp it's required to convert a unix timestamp into human readable timestamp ./scripts/portable_date $unix_timstamp +%T Signed-off-by: Alexander Couzens <lynxis@fe80.eu> SVN-Revision: 48583
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $(uname) in
|
||||
NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
|
||||
date -r $1 $2
|
||||
;;
|
||||
*)
|
||||
date -d @$1 $2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
Reference in New Issue
Block a user