Archive for October, 2009

…and getting the time

Saturday, October 24th, 2009

In 24-hour format. In CMD.

SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~0,1%.%time:~3,2%]
IF "%time:~0,2%" == " 1" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 2" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 3" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 4" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 5" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 6" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 7" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 8" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]
IF "%time:~0,2%" == " 9" SET thetimeanddate=%date:~4,2%-%date:~7,2%-%date:~10,4%[0%time:~1,1%.%time:~3,2%]

Each if is there to throw in the missing 0 if the hour is from 1-9. Weeee.

Decided to make this since I decided to make a dump of my Minecraft server’s backups. And then that led to fixing up the times in the filenames.

Makin’ Music

Saturday, October 17th, 2009