Having strange problem with time subtraction

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
KuroiLight
Posts: 327
Joined: 12 Apr 2015, 20:24
Contact:

Having strange problem with time subtraction

22 Sep 2017, 15:38

trying to subtract 2 days from current time and display it but the commands are acting weird or I'm blind and not seeing something Im doing wrong...

Code: Select all

anow := %A_Now%

FormatTime, sanow, anow, % "MM.dd - HH.mm.ss"
MsgBox, % sanow

anow += -2, Days

FormatTime, sanow, anow, % "MM.dd - HH.mm.ss"
MsgBox, % sanow
keeps giving me current time for both msgboxes
Windows 10, Ryzen 1600, 16GB G.Skill DDR4, 8GB RX 480 | [MyScripts][MySublimeSettings] [Unlicense][MIT License]
01/24/18
[/color]
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Having strange problem with time subtraction

22 Sep 2017, 15:53

Code: Select all

anow := A_Now

FormatTime, sanow,% anow, MM.dd - HH.mm.ss
MsgBox, % sanow

anow += -2, Days

FormatTime, sanow,% anow, MM.dd - HH.mm.ss
MsgBox, % sanow
Tested.
User avatar
KuroiLight
Posts: 327
Joined: 12 Apr 2015, 20:24
Contact:

Re: Having strange problem with time subtraction

22 Sep 2017, 15:59

yea, derp on my part just figured out I forgot %. lol...
:shh:
Windows 10, Ryzen 1600, 16GB G.Skill DDR4, 8GB RX 480 | [MyScripts][MySublimeSettings] [Unlicense][MIT License]
01/24/18
[/color]

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 383 guests