Set time pattern automatically