<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Операции со временем]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15103&amp;type=atom" />
	<updated>2019-12-26T23:07:24Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15103</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137067#p137067" />
			<content type="html"><![CDATA[<p>Можно и так.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-12-26T23:07:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137067#p137067</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137066#p137066" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />А если не сложно можете объяснить пожалуйста как мне допустим значение которое получилось перевести в секунды, для последующей работы</p><p>Это костыльно или я в правильном направлении мыслю?<br /></p><div class="codebox"><pre><code>time = 02:44:29
RegExMatch(time, &quot;(.*):(.*):(.*)&quot;, Out)
sec := Out3 + (Out2 * 60) + (Out1 * 3600)
msgbox, %sec%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Vaks_off]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40530</uri>
			</author>
			<updated>2019-12-26T21:47:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137066#p137066</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137065#p137065" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, <strong>Спасибо!</strong></p><p>Может быть когда нибудь кому-то понадобится)<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>Gui Add, Button, vBut1 g1 x24 y64 w80 h23, &amp;OK
Gui Add, Button, g2 x24 y128 w80 h23, &amp;OK
Gui Add, Button, g3 x24 y192 w80 h23, &amp;OK
Gui Add, Text, vtime1 x16 y32 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vtime2 x16 y96 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vRazn x16 y160 w96 h23 +0x200 +0x1, 0


Gui Show, w126 h236, Window
FormatTime, TimeString, T12, Time

Return

1:
FormatTime, time1, t12, Time
GuiControl,,time1,%time1%
GuiControl, Disable, But1
Return

2:
FormatTime, time2, t12, Time
GuiControl,,time2,%time2%
return

3:
GuiControl,,Razn,% TimeDiff(time1, time2)
GuiControl, Enable, But1

Return

TimeDiff(time1, time2) {
   time1 := 16010101 . Format(&quot;{:02}{:02}{:02}&quot;, StrSplit(time1, &quot;:&quot;)*)
   time2 := 16010101 . Format(&quot;{:02}{:02}{:02}&quot;, StrSplit(time2, &quot;:&quot;)*)
   if (time2 &lt; time1)
      time2 += 1, d
   time2 -= time1, s
   time := 1601
   time += time2, s
   FormatTime, outTime, % time, HH:mm:ss
   Return outTime
}



GuiEscape:
GuiClose:
    ExitApp</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Vaks_off]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40530</uri>
			</author>
			<updated>2019-12-26T21:16:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137065#p137065</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137033#p137033" />
			<content type="html"><![CDATA[<p>Пример:<br /></p><div class="codebox"><pre><code>time1 := &quot;5:42:24&quot;
time2 := &quot;23:30:17&quot;

MsgBox, % TimeDiff(time1, time2)

TimeDiff(time1, time2) {
   time1 := 16010101 . Format(&quot;{:02}{:02}{:02}&quot;, StrSplit(time1, &quot;:&quot;)*)
   time2 := 16010101 . Format(&quot;{:02}{:02}{:02}&quot;, StrSplit(time2, &quot;:&quot;)*)
   if (time2 &lt; time1)
      time2 += 1, d
   time2 -= time1, s
   time := 1601
   time += time2, s
   FormatTime, outTime, % time, HH:mm:ss
   Return outTime
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-12-25T21:27:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137033#p137033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136974#p136974" />
			<content type="html"><![CDATA[<p>Переделал код, сейчас работает как нужно но как преобразовать это в формат HH:MI:SS<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>Gui Add, Button, g1 x24 y64 w80 h23, &amp;OK
Gui Add, Button, g2 x24 y128 w80 h23, &amp;OK
Gui Add, Button, g3 x24 y192 w80 h23, &amp;OK
Gui Add, Text, vTime x16 y32 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vTime2 x16 y96 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vRazn x16 y160 w96 h23 +0x200 +0x1, 0


Gui Show, w126 h236, Window
FormatTime, TimeString, T12, Time

Return

1:
TimeStart := A_Now
GuiControl,,Time,%TimeStart%
msgbox, %TimeStart%
Return

2:
TimeEnd := A_Now
GuiControl,,Time2,%TimeEnd%
msgbox, %TimeEnd%
return

3:
EnvSub, TimeEnd,%TimeStart%
GuiControl,,Razn,%TimeEnd%
MsgBox %TimeEnd% 
return</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Vaks_off]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40530</uri>
			</author>
			<updated>2019-12-23T08:32:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136974#p136974</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Операции со временем]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136968#p136968" />
			<content type="html"><![CDATA[<p>Здравствуйте, подскажите пожалуйста как сделать вычитание времени<br />Я так понял через EnvSub но не могу разобраться как он работает.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>Gui Add, Button, g1 x24 y64 w80 h23, &amp;OK
Gui Add, Button, g2 x24 y128 w80 h23, &amp;OK
Gui Add, Button, g3 x24 y192 w80 h23, &amp;OK
Gui Add, Text, vTime x16 y32 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vTime2 x16 y96 w96 h23 +0x200 +0x1, 0
Gui Add, Text, vRazn x16 y160 w96 h23 +0x200 +0x1, 0


Gui Show, w126 h236, Window
Return

1:
FormatTime, 1, t12, Time
msgbox, %1%
GuiControl,,Time,%1%
Return

2:
FormatTime, 2, t12, Time
msgbox, %2%
GuiControl,,Time2,%2%
return

3:
Razn := Time2 - Time
msgbox, %Razn%
return</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[Vaks_off]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40530</uri>
			</author>
			<updated>2019-12-23T06:11:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136968#p136968</id>
		</entry>
</feed>
