mirror of https://github.com/rwxrob/dot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
211 B
Plaintext
17 lines
211 B
Plaintext
3 years ago
|
#!/usr/bin/bash
|
||
|
set -e
|
||
|
|
||
|
declare arg="$1"
|
||
|
|
||
|
[[ -z $arg ]] && read -r arg
|
||
|
|
||
|
year=${arg:0:4}
|
||
|
month=${arg:4:2}
|
||
|
day=${arg:6:2}
|
||
|
hour=${arg:8:2}
|
||
|
min=${arg:10:2}
|
||
|
sec=${arg:12:2}
|
||
|
|
||
|
echo "$year/$month/$day $hour:$min:$sec"
|
||
|
|