I want to write a time converter in windows batch script. It is going to be used when I want to set an appointment (I want to put it in my email content). The script should be able to print out the following lines (output to clipboard ideally, file is okay too):
Beijing (China) TUE, January 16, 2016 at 8:00 AM
Seattle (U.S.A) MON, January 15, 2016 at 4:00 PM
First of all, I found the windows date
utility can print out the date and time nicely and I want to take advantage of it. Then, for the current time, I found using
tzutil /s "Pacific Standard Time_dstoff"
tzutil /s "China Standard Time"
would be a easy way to get the date and then print it out. It changes the system time to Pacific time and then change it back to China Standard Time.
However, since I do NOT have the root right to change the system time, I am wondering what is the best way to do the time converting for any given new appointment datetime. Say I want to setup an appointment on 2/19/2016 08:00 Beijing time, how could I easily get the following lines into my clipboard?
Beijing (China) TUE, February 19, 2016 at 8:00 AM
Seattle (U.S.A) MON, February 18, 2016 at 4:00 PM