Use the %TIME% pseudo-variable.
You can also use %DATE% in above script.
Both have the same limitations, in that they depend on your locale. The code is not portable and you’ll be up for surprises in other environments. But that’s how date and time in cmd works.