Hey ! Hello all ! Today, I’ll tell you how to do that crazy thing I wrote in the title of this article: deal with date and time under a standard Windows batch script !!
Yes, those « .bat » files ! Not Powershell command files, no no… too simple. ^^
So, if you’re crazy enough to want to use date and time when you’re writting a windows batch script, you certainly ask yourself: « But what the hell I can do this ?! »
Do not broke any keyboard ! I’ve got a part of the answer…
And that’s not so hard. Yes, I am a crazy men who play with stupid things like putting date, time and format them ! So, I search the holy path to the Graal… And I found this Stackoverflow page.
I agree, this is awful. But who tell us that this kind of script is pretty and sexy ? Yeah… NO-BO-DY !
Here’s an example of how to build a custom date variable:
So, now you know how… use it to manage log files, log messages or whatever you want to. And… enjoy ! 😉