format time for  message api