Do you need to write a windows batch and need to get yyyymmdd? It is a nightmare if you deploy your batch file to multiple machines (e.g. different windows version, different locale setting, etc).
Unlike linux, windows build-in date command will output different format for different Windows version (e.g. xp, 2003, 2012) or different localized version. And the user can also customize the output format.
In the old days, I’ll write a little program to do this. But now there is a little tool, yyyymmdd.bat, https://github.com/litalidev/yyyymmdd which seems to work on different Windows versions.