#!/bin/bash
L='['
R=']'

if [[ $1 = -a* ]]
then  # active timestamp
    L='<'
    R='>'
    shift
elif [[ $1 = -i* ]]
then  # inactive timestamp
    L='['
    R=']'
    shift
fi

query_date=${*:-now}
printf "${L}%s${R}\n" "$(date '+%F %a %H:%M' -d "$query_date")"
