Created
February 28, 2018 11:53
-
-
Save hiulit/89bbff523dbaa286c09923eda17c2e31 to your computer and use it in GitHub Desktop.
Convert unhyphenated datetime (20180228T125033) into 2018-02-28T12:50:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date="$(echo "20180228T125033" | cut --output-delimiter=$'-' -c1-4,5-6,7-8)" | |
time="$(echo "20180228T125033" | cut --output-delimiter=$'-' -c10-11,12-13,14-15)" | |
date --utc --date "$date $time" +%s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment