From 3c7b8978d69bb8db1e8171d027fde6153332a3e3 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sun, 11 Aug 2024 18:09:12 +0100 Subject: [PATCH] easyrsa-tools.lib: cert_date_to_time_stamp_s(), macOS alternate format Signed-off-by: Richard T Bonhomme --- dev/easyrsa-tools.lib | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/easyrsa-tools.lib b/dev/easyrsa-tools.lib index 12aa394d..5f9e2496 100644 --- a/dev/easyrsa-tools.lib +++ b/dev/easyrsa-tools.lib @@ -322,6 +322,13 @@ cert_date_to_timestamp_s: input error" )" then : # ok + # Darwin alternative + elif timestamp_s="$( + date -u -j -f '%Y-%m-%d %H:%M:%SZ' \ + "$in_date" +%s 2>/dev/null + )" + then : # ok + # busybox elif timestamp_s="$( busybox date -D "%b %e %H:%M:%S %Y" \