NoEnv SingleInstance Force SetBatchLines -1 Gui, Add, GroupBox, w450 h80, 转换成分钟 Gui, Add, Edit, xp+10 yp+20 Section w100
#NoEnv
#SingleInstance Force
SetBatchLines -1
Gui, Add, GroupBox, w450 h80, 转换成分钟
Gui, Add, Edit, xp+10 yp+20 Section w100 Number Center v_h
Gui, Add, Text, ys, 小时
Gui, Add, Edit, ys w100 Number Center v_m
Gui, Add, Text, ys, 分钟
Gui, Add, Edit, ys w100 Number Center v_s
Gui, Add, Text, ys, 秒钟
Gui, Add, Button, xs Section gConvert Default, 转换
Gui, Add, Text, ys hp 0x200, ----->
Gui, Add, Edit, ys w225 ReadOnly vResult
Gui, Add, GroupBox, xm w450 h80, 向前计算时间差
Gui, Add, Text, xp+10 yp+20 Section, 目标时间:
Gui, Add, DateTime, x+5 w150 vTargetTime, yyyy-MM-dd HH:mm:ss
Gui, Add, Button, xs Section gCalc Default, 计算
Gui, Add, Text, ys hp 0x200, ----->
Gui, Add, Edit, ys w225 ReadOnly vResult2
Gui, Show
Return
Convert:
Gui, Submit, NoHide
Result := ( Floor(_h) * 60 ) + Floor(_m) + ( Floor(_s) / 60 )
GuiControl,, Result, % Result
Return
Calc:
Gui, Submit, NoHide
EnvSub, TargetTime, %A_Now%, Seconds
Result2 := FormatSeconds(TargetTime)
GuiControl,, Result2, % Result2
Return
GuiClose:
ExitApp
; mk:@MSITStore:D:Program%20FilesAutoHotkeyAutoHotkey.chm::/docs/commands/FormatTime.htm
FormatSeconds(NumberOfSeconds) ; Convert the specified number of seconds to hh:mm:ss format.
{
time = 19990101 ; *Midnight* of an arbitrary date.
time += %NumberOfSeconds%, seconds
FormatTime, mmss, %time%, mm:ss
return NumberOfSeconds//3600 ":" mmss
/*
; Unlike the method used above, this would not support more than 24 hours worth of seconds:
FormatTime, hmmss, %time%, h:mm:ss
return hmmss
*/
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

