<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK:конвертация строка->время и операции?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8439</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8439&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK:конвертация строка->время и операции?».]]></description>
		<lastBuildDate>Thu, 04 Jul 2013 09:54:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73461#p73461</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Но по большому счету, главное чтобы работало.</p></blockquote></div><p>По большому счету, надо вникать в &quot;алгоритм <span class="bbu">более</span>* правильных решений&quot;. Тем паче, что:<br /></p><div class="quotebox"><cite>ТС пишет:</cite><blockquote><p>Можно ли как-то немудрено</p></blockquote></div><p>А не :</p><div class="quotebox"><blockquote><p>Приведите все способы решения задачи</p></blockquote></div><p><strong>Malcev</strong><br />Ваш алгоритм можно расписать на 1 строку кода, с помощью выражения. И это очевидно. Я &quot;раскатал&quot; на 4 строки. Чтобы была универсальность, и можно было (при желании) также получать дату в нужном формате.</p><p>---------------------------------</p><p>*Указатель, на относительность утверждения. Т.к. наверняка можно сделать ещё проще.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 04 Jul 2013 09:54:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73461#p73461</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73452#p73452</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>А есть смысл городить огород, когда есть встроенные методы обработки времени?</p></blockquote></div><p>Нету. Я решал задачу ориентировочно своих знаний.<br />Конечно ваш способ короче.<br />Но по большому счету, главное чтобы работало.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 03 Jul 2013 23:50:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73452#p73452</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73431#p73431</link>
			<description><![CDATA[<p>Можно ещё сократить решение:<br /></p><div class="codebox"><pre><code>
StartTime = 21:02:09
Duration = 04:58:01

StringSplit, D, Duration, :
Time := 20010101 RegExReplace(StartTime, &quot;:&quot;), S:=(D1*3600)+(D2*60)+D3
Time += S, S
FormatTime, EndTime, % Time, HH:mm:ss

MsgBox % EndTime
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 03 Jul 2013 09:00:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73431#p73431</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73430#p73430</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А вот и мой исправленный:</p></blockquote></div><p>А есть смысл городить огород, когда есть встроенные методы обработки времени?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 03 Jul 2013 08:37:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73430#p73430</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73423#p73423</link>
			<description><![CDATA[<p>Ваш вариант неправильно форматирует время.<br />Правильней:<br /></p><div class="codebox"><pre><code>FormatTime, Time, % Time, HH:mm:ss</code></pre></div><p>А вот и мой исправленный:<br /></p><div class="codebox"><pre><code>StartTime = 21:02:59
Duration = 48:58:01

StringSplit, Start, StartTime, :
StringSplit, Dur, Duration, :
if (Start3 + Dur3) &gt;= 60
{
   Start3 -=60
   Start2 +=1
}
if (Start2 + Dur2) &gt;= 60
{
   Start2 -=60
   Start1 += 1
}
while (Start1 + Dur1) &gt;= 24
   Start1 -=24
EndTime3 := Start3 + Dur3
EndTime2 := Start2 + Dur2
EndTime1 := Start1 + Dur1
SetFormat, float, 02.0
Loop, 3
   EndTime%A_Index% += 0.0
msgbox, EndTime = %EndTime1%:%EndTime2%:%EndTime3%
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 02 Jul 2013 13:52:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73423#p73423</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73419#p73419</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Можно так:</p></blockquote></div><div class="codebox"><pre><code>StartTime = 21:02:59
Duration = 04:58:01</code></pre></div><p>А на таких значениях?</p><br /><br /><div class="codebox"><pre><code>
StartTime = 21:02:59
Duration = 04:58:01

Time := A_YYYY A_MM A_DD RegExReplace(StartTime, &quot;:&quot;)
StringSplit, Dur, Duration, :
Time += Dur3, S
Time += Dur2, M
Time += Dur1, H
FormatTime, EndTime, % Time, HH:mm:ss

MsgBox % EndTime
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 02 Jul 2013 10:24:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73419#p73419</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73415#p73415</link>
			<description><![CDATA[<p>Можно так:<br /></p><div class="codebox"><pre><code>StartTime = 01:02:59
Duration = 04:58:01

StringSplit, Start, StartTime, :
StringSplit, Dur, Duration, :
if (Start3 + Dur3) &gt;= 60
{
   Start3 -= 60
   Start2 += 1
}
if (Start2 + Dur2) &gt;= 60
{
   Start2 -= 60
   Start1 += 1
}
EndTime3 := Start3 + Dur3
EndTime2 := Start2 + Dur2
EndTime1 := Start1 + Dur1
SetFormat, float, 02.0
Loop, 3
   EndTime%A_Index% += 0.0
msgbox, EndTime = %EndTime1%:%EndTime2%:%EndTime3%
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 01 Jul 2013 21:56:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73415#p73415</guid>
		</item>
		<item>
			<title><![CDATA[AHK:конвертация строка->время и операции?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=73413#p73413</link>
			<description><![CDATA[<p>Доброе утро,</p><p>Есть метки времени - начала неких событий, и есть длительности этих событий.<br />Все вида HH:mm:ss, в формате строки.<br />Можно ли как-то немудрено сложить начала и длительности, дабы получить финалы событий, в том же виде?</p>]]></description>
			<author><![CDATA[null@example.com (Zeirram)]]></author>
			<pubDate>Mon, 01 Jul 2013 21:19:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=73413#p73413</guid>
		</item>
	</channel>
</rss>
