Minimal time function and viscosity solutions