I met the program 1 day ago and I love it!
A question: How to calculate the time of another country?
For example, I want to automatically put something like this: At this moment in China it is 9:30 p.m. and in Canada it is 3:30 p.m.
thank you!
Calculate Time zone
For a known time difference you can do something like this:
Type: Command
Type: Command
Code: Select all
TimeDifference:=-6
LocalTime:=A_Now
AltTime:=LocalTime
AltTime+=%TimeDifference%, Hours
FormatTime, LocalTime, %LocalTime%, Time
FormatTime, AltTime, %AltTime%, Time
Send, At this moment it is %LocalTime% here and %AltTime% in your country.
It works perfect! is what I was looking for!
Could it be done with the days too?
For ex. When in a country it is 10 pm on November 29, in other countries it may be 1:00 am on November 30.
Then, I could show something like:
"At this moment it is 10:01 p.m. from November 29 here, and 01:01 a.m. from November 30 in your country"
thank you very much!
Could it be done with the days too?
For ex. When in a country it is 10 pm on November 29, in other countries it may be 1:00 am on November 30.
Then, I could show something like:
"At this moment it is 10:01 p.m. from November 29 here, and 01:01 a.m. from November 30 in your country"
thank you very much!
Marko already gave a solution, you just need to adjust FormatTime command. There are many options:
https://autohotkey.com/docs/commands/FormatTime.htm
https://autohotkey.com/docs/commands/FormatTime.htm
Code: Select all
TimeDifference:=-6
LocalTime:=A_Now
AltTime:=LocalTime
AltTime+=%TimeDifference%, Hours
FormatTime, ltime, %LocalTime%, Time
FormatTime, atime, %AltTime%, Time
FormatTime, ldate, %LocalTime%, MMMM d
FormatTime, adate, %AltTime%, MMMM d
Send, At this moment it is %ltime% from %ldate% here and %atime% from %adate% in your country.