I combined some command in bash so I can get what I want.
#!bin/bash echo Enter your ping's ip? read varip ping $varip | while read pong; do echo "$(date): $pong"; done | tee -a mylog.log
The date command giving the ping output a timestamp. While the ‘tee’ will put the result into the log file.