add message with timestamp and get messages by timestamp