We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to implement a date converter in fmtdate from Unix Epoch or Excel Epoch?
fmtdate
See below:
echo -e "date\n1737454964\n1737454954" | csvtk fmtdate -f 1 --unix-epoch echo -e "date\n45674.412777777776\n45674.410474537035" | csvtk fmtdate -f 1 --excel-epoch
See the explanation the ChatGPT Enterprise gave me for this (in bash):
# Input Excel serial date excel_date="45677.39685185185" # Define constants excel_epoch="1900-01-01" unix_epoch="1970-01-01" # Convert Excel date to seconds since the Unix epoch seconds_since_epoch=$( awk -v ed="$excel_date" 'BEGIN { excel_epoch_offset = 25569; # Excel epoch in days since Unix epoch seconds_per_day = 86400; seconds_since_epoch = (ed - excel_epoch_offset) * seconds_per_day; print seconds_since_epoch; }' ) # Format the date in YYYY-MM-DD hh:mm:ss formatted_date=$(date -u -d "@$seconds_since_epoch" +"%Y-%m-%d %H:%M:%S") echo "$formatted_date"
The text was updated successfully, but these errors were encountered:
It seems that the package for parsing date (https://github.com/araddon/dateparse) can support it (UNIX epoch)
Sorry, something went wrong.
No branches or pull requests
Would it be possible to implement a date converter in
fmtdate
from Unix Epoch or Excel Epoch?See below:
See the explanation the ChatGPT Enterprise gave me for this (in bash):
The text was updated successfully, but these errors were encountered: