aboutsummaryrefslogtreecommitdiffstats
path: root/bin/func
diff options
context:
space:
mode:
Diffstat (limited to 'bin/func')
-rw-r--r--bin/func14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/func b/bin/func
index 4fe632e..62d65a0 100644
--- a/bin/func
+++ b/bin/func
@@ -20,6 +20,8 @@ website_language="en"
date_default_hour="17:00:00"
date_default_timezone="+0200"
+uname=$(uname)
+
__get_value() {
# 1: filename
# 2: Attribute name
@@ -60,7 +62,11 @@ __get_value_date() {
__get_value_date_human() {
# 1: filename
# Get a human readable date from a file and return a safe string.
- __get_value_date "${1}" | xargs date -j -f "%Y-%m-%d" +"%B %d, %Y"
+ if [ "${uname}" = "Linux" ]; then
+ __get_value_date "${1}" | xargs date +"%B %d, %Y" -d
+ else
+ __get_value_date "${1}" | xargs date -j -f "%Y-%m-%d" +"%B %d, %Y"
+ fi
}
__get_value_date_publication() {
@@ -71,7 +77,11 @@ __get_value_date_publication() {
_date="$(__get_value_date ${1})"
_date="${_date} ${date_default_hour} ${date_default_timezone}"
- date -j -f "%Y-%m-%d %H:%M:%S %z" +"%a, %d %b %Y %H:%M:%S %z" "${_date}"
+ if [ "${uname}" = "Linux" ]; then
+ date -d "${_date}" +"%a, %d %b %Y %H:%M:%S %z"
+ else
+ date -j -f "%Y-%m-%d %H:%M:%S %z" +"%a, %d %b %Y %H:%M:%S %z" "${_date}"
+ fi
}
__get_out_filename() {
remember that computers suck.