You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
390 B
22 lines
390 B
function tstodate() {
|
|
[[ $# -eq 0 ]] && return 1
|
|
date -d @${1} +%Y-%m-%d
|
|
}
|
|
|
|
function extracttime() {
|
|
local OIFS=${IFS}
|
|
|
|
if [[ $# -eq 0 || -z $1 ]]
|
|
then
|
|
TIMEKEY=""
|
|
TIME="00:00:00"
|
|
else
|
|
IFS=:
|
|
set -- $=1
|
|
IFS=${OIFS}
|
|
TIMEKEY=$1
|
|
TIME=$(printf "%02d:%02d:%02d" ${2:-0} ${3:-0} $4)
|
|
fi
|
|
}
|
|
|
|
# vim: set et ts=4 sw=4:
|