Created
June 3, 2011 03:03
-
-
Save weakish/1005791 to your computer and use it in GitHub Desktop.
#sh script to convert date formats
This file contains 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
#!/bin/sh | |
# by Jakukyo Friel <weakish@gmail.com> under GPL v2. | |
### This script convert date formats: | |
# YYYY-MM-DD => YYYY-MM-DD | |
# YYYY-M-DD => YYYY-MM-DD | |
# YYYY-MM-D => YYYY-MM-DD | |
# YYYY-M-D => YYYY-MM-DD | |
sed -r 's/-([1-9]-)/-0\1/g' | sed -r 's/-([1-9])($|[^-0-9])/-0\1\2/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment