I have been trying to find a way of getting a windows batch file to display the current UTC time when run. So in other words get the current amount of milliseconds since it was initiated in 1970.
Does anyone know how to do this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using WMI:
This will set the variables
Day,DayofWeek,Hour,Minute,Month,Quarter,Second,WeekInMonthandYearwhich you can use, then.You won’t get a time with Unix epoch from Windows easily, though. If you have PowerShell you can use
which you can call from a batchfile via
But in that case you could write your batch file in a real language anyway.