diff --git a/bb.sh b/bb.sh index 3380c98..67fc3ab 100755 --- a/bb.sh +++ b/bb.sh @@ -147,6 +147,8 @@ global_variables() { # The locale to use for the dates displayed on screen (not for the timestamps) date_format="%B %d, %Y" date_locale="C" + # Date options which work on both BSD and GNU date variants + date_R='+%a, %d %h %Y %H:%M:%S %z' } # Prints the required google analytics code @@ -177,7 +179,8 @@ google_analytics() { # # $1 the file to edit edit() { - timestamp="$(date -r $1 +'%Y%m%d%k%M')" + # timestamp="$(date -r $1 +'%Y%m%d%k%M')" + timestamp="$(stat -f "%Sm" -t '%Y%m%d%k%M' $1)" $EDITOR "$1" touch -t $timestamp "$1" } @@ -238,9 +241,11 @@ create_html_page() { echo "$title" >> "$filename" echo '' >> "$filename" if [ "$timestamp" == "" ]; then - echo '