Time substracting bug Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Time substracting bug

28 Jul 2019, 04:54

This code was working today, but then I changed something (or not), and it started to show errors: https pastenow.ru /689RD

This is current version:

Code: Select all

#NoEnv

gmt_time := A_Now
gmt_time -= 3, hours
FormatTime, rss_time, gmt_time, ddd, dd MMM yyyy HH:mm:ss 'GMT'
MsgBox, % rss_time
The purpose is to format local system time into GMT time, by subtracting 3 hours.

Please check if AHK shows error with this code on your system too.
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Time substracting bug  Topic is solved

28 Jul 2019, 05:24

Yes. It gives an error. I think you should go like this:

Code: Select all

gmt_time := A_Now
gmt_time += -3, hours 
FormatTime, rss_time, %gmt_time%, ddd, dd MMM yyyy HH:mm:ss 'GMT'
MsgBox, % rss_time
or

Code: Select all

FormatTime, rss_time, %A_NowUTC%, ddd, dd MMM yyyy HH:mm:ss 'GMT'
MsgBox, % rss_time
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: Time substracting bug

28 Jul 2019, 06:49

Thank you alot, it works! :dance: :clap: :bravo:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, fiaztv1, Google [Bot], JKJadan, Pianist and 173 guests