<?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=14803&amp;type=atom" />
	<updated>2019-05-28T19:08:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14803</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134474#p134474" />
			<content type="html"><![CDATA[<p>Хотя у <strong>teadrinker</strong> плюс в том, что при некорректной дате будет пустая строка, а в моём варианте будет текущее время.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-05-28T19:08:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134474#p134474</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134470#p134470" />
			<content type="html"><![CDATA[<p>На строчку длиннее, но без RegEx.<br /></p><div class="codebox"><pre><code>
Var1 = 01:59:01
time := &quot;19700101&quot; . StrReplace(Var1, &quot;:&quot;)
time += 59, s 
FormatTime, time, % time, hh:mm:ss
MsgBox, % time
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-05-28T17:49:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134470#p134470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134469#p134469" />
			<content type="html"><![CDATA[<p>Через EnvAdd:<br /></p><div class="codebox"><pre><code>Var1 = 01:59:01
time := &quot;19700101&quot; . StrReplace(Var1, &quot;:&quot;)
time += 59, s
MsgBox, % newTime := RegExReplace(time, &quot;.*?(..(?=(....|..)$))&quot;, &quot;$1:&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-05-28T14:15:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134469#p134469</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134466#p134466" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>time := &quot;01:59:01&quot;
MsgBox % TimeFormat(SecFormat(time) + 59)

ExitApp
SecFormat(time_str) {
	t := StrSplit(time_str, &quot;:&quot;)
	return t[1] * 3600 + t[2] * 60 + t[3]
}
TimeFormat(time_sec) {
	return Format(&quot;{:02}:{:02}:{:02}&quot;   , (h := time_sec // 3600)
										, (m := (time_sec - h * 3600) // 60)
										, time_sec - (h * 3600 + m * 60))
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2019-05-28T09:17:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134466#p134466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134465#p134465" />
			<content type="html"><![CDATA[<p><strong>stealzy</strong><br />уже вроде бы разобрался.<br />Я просто конвертировал часы, минуты в секунды, потом прибавляю нужное количество секунд и обратно конвертирую в часы:минуты:секунды.</p><div class="codebox"><pre><code>   RegExMatch(Var, &quot;^(..):(..):(..)$&quot;, t)
   HR := t1
   ME := t2
   SD := t3
   HR *= 60
   HR *= 60
   ME *= 60
   SD := HR + ME
SD += 2700</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2019-05-28T08:07:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134465#p134465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Прибавить время, в текущее время, в переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134463#p134463" />
			<content type="html"><![CDATA[<p>Здравствуйте!</p><p>Имеется переменная, в данной переменой значение<br /></p><div class="codebox"><pre><code>Var1 = 01:59:01</code></pre></div><p>Соответственно это Час:Минута:Секунда<br />Как прибавить 59 секунд, чтобы получилось 02:00:00?</p><p>P.S Мне нужно, простой командой, прибавлять некоторое время, в текущее время.<br />Пробовал узнать про функцию envadd, но ничего не понял, т.к там есть только пример с текущей датой на моем пк, а если я допустим хочу из Log файла вытащить время и прибавить к нему, то нигде про это найти не смог.</p><p>Прошу помощи!</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2019-05-28T02:18:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134463#p134463</id>
		</entry>
</feed>
