formatting timestamp and converting to localtime