How do I get the current date and time using VBS (for Windows. I\'m not looking for VBScript for ASP/ASPX or webpages).
This is an old question but alot of the answers in here use VB or VBA. The tag says vbscript (which is how I got here).
The answers here got kind of muddled since VB is super broad where you can have so many applications of it. My answer is solely on vbscript and accomplishes my case of formatting in YYYYMMDD in vbscript
Sharing what I've learned:
DateTime functions in vbscript defined here so you can mix-n-match to get the result that you wantYYYYMMDD to do that I just needed to concat DatePart like so for the current Date: date = DatePart("yyyy",Date) & DatePart("m",Date) & DatePart("d",Date)That's all, I hope this helps someone.