Closed k----n closed 3 years ago
It does remove the timezone and timezone is actually useful in some cases (detecting ids for the same author). On the other hand, having a clean original unix seconds is also quite helpful as the tz is often messed up.
I wrote a bash script to move the timezone into the unix seconds that modifies the output of ~/lookup/showCnt commit 2
, maybe there could be a format that does that?
#!/bin/bash
while IFS= read -r a; do
commitID="$( echo "$a" | cut -d\; -f1 )";
author="$( echo "$a" | cut -d\; -f2 )";
dateString="$( echo "$a" | cut -d\; -f3 )";
d0="$( echo "$dateString" | cut -d ' ' -f1 )";
d1="$( echo "$dateString" | cut -d ' ' -f2 )";
if [[ "$d1" == *"+"* ]];
then
Tz="$(echo $d1 | sed "s/+/-/")"
else
Tz="$(echo $d1 | sed "s/-/+/")"
fi
noTz=$(date -ud @$d0 +'%a, %d %b %Y %H:%M:%S');
adjusted=$(date "+%s" -ud "$noTz $Tz");
echo "$commitID;$adjusted;$dateString;$author"
done
for options 2 and 6 I added tz info after timestamp 6f4384cce903a24193b94cb7f58155b8f83e2e87
It changes functionality, so if it is defined in docs need to change as well
Not sure if this is intended behavior (note the +1100):
vs