找回密码
 加入
搜索
查看: 3184|回复: 3

[AU3基础] [已解决]有没有计算时间间隔的函数?

[复制链接]
发表于 2010-8-2 19:14:32 | 显示全部楼层 |阅读模式
本帖最后由 xyold1 于 2010-8-3 11:09 编辑

我要算2004年2月5日15时20分30秒与2010年5月1日20分40秒,之间相差了多少年多少月多少日多少小时分秒,请问有没有计算这种时间的UDF?
发表于 2010-8-2 19:20:58 | 显示全部楼层
_DateDiff()
 楼主| 发表于 2010-8-2 19:28:03 | 显示全部楼层
谢谢,我去看看
 楼主| 发表于 2010-8-2 19:31:20 | 显示全部楼层
_DateDiff
--------------------------------------------------------------------------------

Returns the difference between 2 dates, expressed in the type requested


#Include <Date.au3>
_DateDiff($sType, $sStartDate, $sEndDate)




Parameters

$sType One of the following:
D = Difference in days between the given dates
M = Difference in months between the given dates
Y = Difference in years between the given dates
w = Difference in Weeks between the given dates
h = Difference in hours between the given dates
n = Difference in minutes between the given dates
s = Difference in seconds between the given dates
$sStartDate Input Start date in the format "YYYY/MM/DD[ HH:MM:SS]"
$sEndDate Input End date in the format "YYYY/MM/DD[ HH:MM:SS]"



Return Value

Success: Difference between the 2 dates.
Failure: Returns 0 and set @error
@error: 0 - No error
1 - Invalid $sType
2 - Invalid $sStartDate
3 - Invalid $sEndDate


还行吧
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-3 12:34 , Processed in 0.077997 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表